How to delete docker image

王林
Release: 2020-07-07 17:49:02
forward
5584 people have browsed it

How to delete docker image

具体方法如下:

(推荐教程:docker教程

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

docker stop $(docker ps -a -q)
Copy after login

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

docker rm $(docker ps -a -q)
Copy after login

2、查看当前有些什么images

docker images
Copy after login

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

docker rmi 
Copy after login

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

docker rmi $(docker images | grep "^" | awk "{print $3}")
Copy after login

要删除全部image的话

docker rmi $(docker images -q)
Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!