diff --git a/docker_prune/compose.yml b/docker_prune/compose.yml new file mode 100644 index 0000000..8d61d66 --- /dev/null +++ b/docker_prune/compose.yml @@ -0,0 +1,14 @@ +# This docker-compose file defines a service that runs the `docker system prune` command to clean up unused Docker resources. +# The service is set to run in global mode, meaning it will run on all nodes in the Docker swarm, and it will not restart after completion. + +#version: '3.7' +services: + system-prune: + image: docker + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + command: docker system prune --all --force --volumes + deploy: + mode: global + restart_policy: + condition: none diff --git a/prune_everything.sh b/prune_everything.sh index 0032426..3bae4a6 100755 --- a/prune_everything.sh +++ b/prune_everything.sh @@ -1,3 +1,7 @@ # Script to prune everything in docker. -docker system prune --all --force +#docker system prune --all --force + +cd docker_prune +docker compose up -d +cd ..