Docker删除镜像报错

Posted kazihuo

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Docker删除镜像报错相关的知识,希望对你有一定的参考价值。

问题描述:

笔者意图删除nginx-file的镜像文件,但通过命令删除镜像时出现报错信息,提示存在多个引用(即一个IMAGE可被多个REPOSITORY引用,故删除会出现失败),如下:

[[email protected] ~]# docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
kazihuo/nginx       v1                60c22883bb42        6 minutes ago       372 MB
nginx-file          v1                60c22883bb42        6 minutes ago       372 MB

[[email protected] ~]# docker rmi 60c22883bb42

Error response from daemon: conflict: unable to delete 60c22883bb42 (must be forced) - image is referenced in multiple repositories

 

解决方案:

当指定IMAGE ID删除报错时,可直接通过REPOSITORY:TAG的方式删除;

[[email protected] ~]# docker rmi nginx-file:v1

Untagged: nginx-file:v1

[[email protected] ~]# docker images

REPOSITORY       TAG                 IMAGE ID            CREATED             SIZE

kazihuo/nginx    v1                  60c22883bb42       11 minutes ago      372 MB

 

以上是关于Docker删除镜像报错的主要内容,如果未能解决你的问题,请参考以下文章

docker删除镜像的时候报错--image has dependent child images

docker删除镜像时报错解决办法

docker删除镜像报错处理:Error response from daemon: conflict: unable to delete a945e7fd5401 (cannot be forced

docker 如何删除none镜像

docker私有镜像仓库搭建和镜像删除

解决docker删除容器镜像报错Error response from daemon: conflict: unable to delete 7cc1942f1ed5 (must be forced)