在 Docker 中删除 image 时有时会遇到类似
Error response from daemon: conflict: unable to delete 6ec9a5a0fc9f (cannot be forced) - image has dependent child images这样的错误,原因是有另外的 image FROM 了这个 image,可以使用下面的命令列出所有在指定 image 之后创建的 image 的父 image
docker image inspect --format='{{.RepoTags}} {{.Id}} {{.Parent}}' $(docker image ls -q --filter since=xxxxxx)其中 xxxxxx 是报错 image 的 id,在文章开头的例子中就是 6ec9a5a0fc9f。从列表中查找到之后就可以核对并删除这些 image。

本文介绍了解决Docker中删除image时遇到的依赖冲突问题,并提供了一条实用命令来帮助查找并删除依赖的image。
7025

被折叠的 条评论
为什么被折叠?



