4 ms·
I have a gist for it: https://gist.github.com/pubkey/73dcb894cf5f7d262863 https://gist.github.com/pubkey/73dcb894cf5f7d262863 #stop and delete all containers
by realPubkey 10y ago
I 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)