报错
删除镜像时报错:
[root@iZhp33j6fklnmhbf0lz2obZ ~]# docker rmi test:latest
Error response from daemon: conflict: unable to remove repository reference "test:latest" (must force) - container
1c21d7ca4d79 is using its referenced image 90cb9f03bf34
解决
报错内容是因为镜像被容器引用,那么删除容器在删除镜像。
# 删除容器
docker rm 1c21d7ca4d79
[root@iZhp33j6fklnmhbf0lz2obZ ~]# docker rm 1c21d7ca4d79
Error response from daemon: You cannot remove a running container 1c21d7ca4d79eddd1e81112af422f1e878882174b625f707ecd5e04a08f6aed5.
Stop the container before attempting removal or force remove
报错:Error response from daemon: You cannot remove a running container
服务还在运行中,先停止服务。
docker stop 1c21d7ca4d79
效果如下:文章来源:https://www.toymoban.com/news/detail-581810.html
[root@iZhp33j6fklnmhbf0lz2obZ ~]# docker stop 1c21d7ca4d79
1c21d7ca4d79
[root@iZhp33j6fklnmhbf0lz2obZ ~]# docker rm 1c21d7ca4d79
1c21d7ca4d79
[root@iZhp33j6fklnmhbf0lz2obZ ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@iZhp33j6fklnmhbf0lz2obZ ~]# docker rmi test:latest
Untagged: test:latest
Deleted: sha256:90cb9f03bf34fcdd4e1251efecfd9aa1d0022b3b0cdefb8dbbcba0beac4871c1
Deleted: sha256:a6ef7a1dc59d4add9e33cb392a378c35b85428b8efb5b58ef742f99ee7a643e9
Deleted: sha256:981fa111d1889557f2a724d555e0f9de9743c0cf4bd6a56d0b5c3f70891a212d
Deleted: sha256:eaf08a89e93fa3224ed5a240f8b8c3be8e94d3a26f9842ca02d21251e6b3b4fd
Deleted: sha256:d1fff27a59a468370a488b33b51164e44e2253603fae5f25bf4c523408c22da7
Deleted: sha256:d7b00194a3bd08bdfd3a5c0d4af56a633111ba98a0da84ee8fc0b3508ef5bd08
Deleted: sha256:09b04035face4fc130b8c7bf8adb56f0374ef1a4c66a63673ad6fc270b2ea8c4
Deleted: sha256:eee89b706a8b1afcae8288b9671fa44e7eaa72d00b4d9173590e35e6ba46ba80
Deleted: sha256:fd8c18124df7f082bd9707fca8effecf6315755c1c54a867507ebbea7b46051c
鱼跃此时海,花开彼岸天。文章来源地址https://www.toymoban.com/news/detail-581810.html
到了这里,关于Docker报错:Error response from daemon: conflict: unable to remove repository reference的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!