6 ms·
Looks like there's a mistake about image pruning: "Add -f to get rid of all unused images (ones with no containers running them)." But the option is actually
by joekrill 10y ago
Looks like there's a mistake about image pruning:
"Add -f to get rid of all unused images (ones with no containers running them)."
But the option is actually `-a` -- `-f` just simply skips the prompt.
- willemmali 10y agoLike this? docker rmi -af I'm a bit confused by the backticks as I use them all the time scripting, but also in Markdown.
- realPubkey 10y agoI have a gist for it: https://gist.github.com/pubkey/73dcb894cf5f7d262863 https://gist.github.com/pubkey/73dcb894cf5f7d262863 #stop and delete all containers docker rm -f $(docker ps -a -q) #delete all images docker rmi -f $(docker images -q)
- assaflavie 10y agofwiw, there's a new syntax for this, that is a bit more verbose, but probably worth adopting: docker container rm $(docker container ls -qa) docker image rm $(docker image ls -q)
- e40 10y agoThis is NOT equivalent. The OP was talking about removing unused images. Your commands remove all images.
- lloeki 10y agoMaybe this? docker rm $(docker ps -qa --no-trunc --filter "status=exited") docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
- assaflavie 10y agoOops. Thanks for bringing this to my attention. Fixing...