docker镜像无法删除解决

问题:

使用docker rmi -f [imageid]无法删除镜像,并报错,见下面的批量删除操作:

docker rmi -f $(docker images -q)
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist
Error response from daemon: reference does not exist

解决:

1、使用tag删除

docker rmi -f [REPOSITORY]:[TAG ]

可以删除部分镜像。仍然有镜像删除不掉,只好用下面的大法了。

2、彻底删除所有镜像

systemctl stop docker.service
rm -rf /var/lib/docker
systemctl start docker.service

注意:该命令会删除所有的镜像,在删除前,要先备份好需要保存的镜像。

posted @ 2019-02-18 14:24  hongweigg  阅读(231)  评论(0编辑  收藏  举报