[Docker] Understanding `docker stack deploy --prune` in Docker Swarm
When managing services in Docker Swarm mode, the --prune flag in docker stack deploy helps keep your stack synchronized with your compose file. It ensures that only the services defined in your current file remain running, and anything outdated is automatically cleaned up. What the --prune Flag Does When you run this command: docker stack deploy -c docker-compose.yml mystack --prune Docker compares your current stack with the new compose file and performs three actions: ...