Added swarm wide prune option

This commit is contained in:
2026-05-31 16:29:58 +02:00
parent e9093733a0
commit da8f591739
2 changed files with 19 additions and 1 deletions
+14
View File
@@ -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
+5 -1
View File
@@ -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 ..