Tuesday, July 4, 2017

docker container images delete command summary

Docker container images delete command summary

1.show all docker container:
$ docker ps -a -q
stop all running container:
docker stop $(docker ps -a -q)
then you can delete all images:
$ docker rm $(docker ps -a -q)
2.show all images:
$ docker images
3.delete one image by id:
$ docker rmi <image id>
delete untagged images, which id is <None>:
$ docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
delete all images:
$ docker rmi $(docker images -q)
last
thanks!

No comments: