Symptoms
I tried to delete an image file in Docker and got an error
$ docker rmi d56
Error response from daemon: conflict: unable to delete d562087633bf (cannot be forced) - image has dependent child imagesForcing the deletion
$ docker rmi d56 -f
Error response from daemon: conflict: unable to delete d562087633bf (cannot be forced) - image has dependent child imagesCause
The error seems to say that child image files depend on it.
Specifying the repository name and tag name rather than the ID sometimes lets you delete it
$ docker rmi REPOSITORY:TAG
or
$ docker rmi -f REPOSITORY:TAGIf that deleted it for you, the rest below is unnecessary
If it still cannot be deleted, look into the dependent files
(The image I wanted to remove here is d56, so change it as appropriate)
$ for i in $(docker images -q)
do
docker history $i | grep -q d56 && echo $i
done | sort -uResult
ab51490dbf8a
d562087633bfBesides d562087633bf, ab51490dbf8a was listed
Deleting them
$ docker rmi ab5 d56