I'm trying to remove an image and I get:
# docker rmi f50f9524513f
Failed to remove image (f50f9524513f): Error response from daemon: conflict: unable to delete f50f9524513f (cannot be forced) - image has dependent child images
This is the docker version:
# docker version
Client:
Version: 1.10.3
API version: 1.22
Go version: go1.5.3
Git commit: 20f81dd
Built: Thu Mar 10 21:49:11 2016
OS/Arch: linux/amd64
Server:
Version: 1.10.3
API version: 1.22
Go version: go1.5.3
Git commit: 20f81dd
Built: Thu Mar 10 21:49:11 2016
OS/Arch: linux/amd64
but there is no extra information:
# docker images --format="raw" | grep f50f9524513f -C3
repository: debian
tag: 8
image_id: f50f9524513f
created_at: 2016-03-01 18:51:14 +0000 UTC
virtual_size: 125.1 MB
repository: debian
tag: jessie
image_id: f50f9524513f
created_at: 2016-03-01 18:51:14 +0000 UTC
virtual_size: 125.1 MB
How can I get the dependent child images it claims to have?
there are no running nor stopped containers with that image id.
This is what I did in order to preserve my final "image" (layer, really - which is what threw me off, as I am just getting into docker builds).
I was getting the whole "... cannot be forced..." message. I realized I couldn't delete the images I didn't need because they are not really independent images created by 'docker commit'. My issue was, I had several images (or layers) between the base image and my final, and just trying to clean up is where I met the error/warning about the child and parent.
docker image load -i FinalImage.tar.gz
. The output was something like:Loaded image ID: sha256:82d4f8ef9ea1eab72d989455728762ed3c0fe35fd85acf9edc47b41dacfd6382
Now, when I list with 'docker image ls', I only have the original base image, and the final image I previously saved to a tarball.
My system is 'clean' now. I only have the images I want. I even deleted the base image without a problem.
I've created a gist with shell script to print out descendant tree of a docker image, should anyone be interested in bash solution: