有两个id相同的镜像,移除镜像的时候会报错:
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
XXX:9004/ubuntu latest 0458a4468cbc 12 days ago 111.7 MB
XXX:9002/ubuntu latest 0458a4468cbc 12 days ago 111.7 MB
docker rmi 0458a4468cbc
Error response from daemon: conflict: unable to delete 0458a4468cbc(must be forced) - image is referenced in one or more repositories
解决办法:使用repository和tag进行删除
docker rmi XXX:9004/maven:latest
Untagged: XXX:9004/maven:latest
Untagged: XXX:9004/maven@sha256:74efa024228bcb4a9f4c8612b8962c369a36c86e0718519c94c04c44acdd45da
网友评论