Added swarm wide prune option
This commit is contained in:
@@ -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
@@ -1,3 +1,7 @@
|
|||||||
# Script to prune everything in docker.
|
# Script to prune everything in docker.
|
||||||
|
|
||||||
docker system prune --all --force
|
#docker system prune --all --force
|
||||||
|
|
||||||
|
cd docker_prune
|
||||||
|
docker compose up -d
|
||||||
|
cd ..
|
||||||
|
|||||||
Reference in New Issue
Block a user