Skip to content

Instantly share code, notes, and snippets.

@monkeym4ster
Last active March 4, 2016 07:38
Show Gist options
  • Save monkeym4ster/b88438ae18d6fc00fc48 to your computer and use it in GitHub Desktop.
Save monkeym4ster/b88438ae18d6fc00fc48 to your computer and use it in GitHub Desktop.
Docker Cheat Sheet

删除镜像

删除所有镜像

docker rmi $(docker images -q)

删除所有未打 tag 的镜像

docker rmi $(docker images | awk '/^<none>/ { print $3 }')

删除所有以 xxx 开头的镜像

docker rmi $(docker images | awk '/^xxx/ { print $1 }')

删除容器

删除所有容器

docker rm $(docker ps -a)

删除所有未运行的容器

docker rm $(docker ps -a -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment