[swarm-cleaner] docker image prune -a deletes all images, not just dangling ones #22

Open
opened 2026-04-16 16:26:31 +02:00 by diyon · 0 comments
Contributor

The current command removes all unused images including tagged ones, which can break running services that rely on older image versions (e.g. for rollbacks).

File: swarm-cleaner/compose-stack.yml

Current (bad):

docker image prune -f -a  # removes ALL unused images

Better (safe):

docker image prune -f  # only dangling images (default behavior)

This keeps tagged images that are not currently in use, which is safer for Swarm deployments where you might need to rollback.

The current command removes **all** unused images including tagged ones, which can break running services that rely on older image versions (e.g. for rollbacks). **File:** `swarm-cleaner/compose-stack.yml` **Current (bad):** ```sh docker image prune -f -a # removes ALL unused images ``` **Better (safe):** ```sh docker image prune -f # only dangling images (default behavior) ``` This keeps tagged images that are not currently in use, which is safer for Swarm deployments where you might need to rollback.
diyon closed this issue 2026-04-17 12:46:18 +02:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kreativmonkey/homelab-app#22
No description provided.