By using this website you agree to our
Back to templates
Back to Templates

Docker cheatsheet

Delete all container created by docker-compose

$ docker rm `docker ps --no-trunc -aq

Build docker-compose without cache

$ docker-compose build --no-cache

Purge containers and unused image

$ docker ps -q -a -f status=exited | xargs -n 100 docker rm -v

$ docker images -q --filter "dangling=true" | xargs -n 100 docker rmi

Clean all your docker cache ALL

$ docker rm $(docker ps -a -q)

$ docker rmi $(docker images -q)

$ docker volume rm

$(docker volume ls |awk '{print $2}') rm -rf ~/Library/Containers/com.docker.docker/Data/*@