Created
March 6, 2018 15:42
-
-
Save sun4lower/b73646bd0b841e07c0172eaff6c0c7a9 to your computer and use it in GitHub Desktop.
Docker command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 列举当前本地正在运行的容器 | |
docker container ls | |
# 列举出所有的容器 | |
docker container ls -a | |
docker ps -a | |
# 删除指定ID的Container | |
docker container rm ContainerID | |
docker rm ContainerID | |
# 列举出所有的镜像 | |
docker images | |
docker image ls | |
# 删除指定ID的镜像 | |
docker rmi ImageID | |
docker image rm ImgaeID | |
# 列举出所有的Container的ID | |
docker container ls -aq | |
docker container ls -a | awk {'print$1'} | |
# 移除掉所有的Container | |
docker container rm ${docker container ls -aq} | |
# 移除掉所有状态为exited的Container,-q表示只显示ID | |
docker rm $(docker container ls -f "status=exited" -q) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment