Home  >  Article  >  Operation and Maintenance  >  How to delete docker image

How to delete docker image

王林
王林forward
2020-07-07 17:49:025666browse

How to delete docker image

具体方法如下:

(推荐教程:docker教程

1、停止所有的container,这样才能够删除其中的images:

docker stop $(docker ps -a -q)

如果想要删除所有container的话再加一个指令:

docker rm $(docker ps -a -q)

2、查看当前有些什么images

docker images

3、删除images,通过image的id来指定删除谁

docker rmi <image id>

想要删除untagged images,也就是那些id为d648d7d84be222d28bc97c69767ed12f的image的话可以用

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

要删除全部image的话

docker rmi $(docker images -q)

The above is the detailed content of How to delete docker image. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete