From 1a9dac03b8415d552d81c036e3cebbaac276ddee Mon Sep 17 00:00:00 2001 From: jon r Date: Fri, 4 Apr 2025 14:22:10 +0200 Subject: [PATCH] docs(developer/setup/docker): add information about container engine lifecycle --- docs/developer/setup/docker.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/developer/setup/docker.md b/docs/developer/setup/docker.md index 1d39d8c46..d391be53b 100644 --- a/docs/developer/setup/docker.md +++ b/docs/developer/setup/docker.md @@ -329,6 +329,40 @@ instances: rm -rf .state/ ``` +### Container engine + +Your container engine, often Docker or Podman, over time will accumulate state. +This state comes in form of images, networks and containers. Due to the nature +of immutable infrastructure, assets are often replaced with newer generations. + +For images this means that old ones pile up, while new ones are being used with +current containers. + +Delete dangling images regularly. + +```sh +docker image prune +``` + +Delete all unused images, which are not used by any container, regularly. + +```sh +docker image prune -a +``` + +Delete all unused networks regularly. + +```sh +docker network prune +``` + +In case you run into trouble, as a last resort you can always reset the state of +your container engine completely. + +```sh +docker system prune -a +``` + ## Running multiple instances Set up as many different projects as you need. Make sure the