Docker:删除images报错(Error response from daemon: conflict: unable to delete 6885a5e3712a (must be forced) - image is being used by stopped container 0cf27d7d29c7)

1.进入root权限

sudo su

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

docker stop $(docker ps -a -q)

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

docker rm $(docker ps -a -q)

3.查看当前有些什么images

docker images

4.删除images,通过image的id来指定删除谁

docker rmi

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

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

要删除全部image的话

docker rmi $(docker images -q)

  

上一篇:新版Go2Shell 安装详解


下一篇:Error response from daemon: conflict: unable to delete a2f2e369e78e (cannot be forced) - image has dependent child images