I am trying
docker rmi c565603bc87f
Error:
Error response from daemon: conflict: unable to delete c565603bc87f (cannot be forced) - image has dependent child images
So i can't delete image even with -f flag. How to delete image then and all of its children ?
Linux and docker version:
uname -a Linux goracio-pc 4.4.0-24-generic #43-Ubuntu SMP Wed Jun 8 19:27:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
docker version Client: Version: 1.11.2 API version: 1.23 Go version: go1.5.4 Git commit: b9f10c9 Built: Wed Jun 1 22:00:43 2016 OS/Arch: linux/amd64
Server: Version: 1.11.2 API version: 1.23 Go version: go1.5.4 Git commit: b9f10c9 Built: Wed Jun 1 22:00:43 2016 OS/Arch: linux/amd64
you can just do this:
➜ ~ sudo docker rmi 4ed13257bb55 -f Deleted: sha256:4ed13257bb5512b975b316ef482592482ca54018a7728ea1fc387e873a68c358 Deleted: sha256:4a478ca02e8d2336595dcbed9c4ce034cd15f01229733e7d93a83fbb3a9026d3 Deleted: sha256:96df41d1ce6065cf75d05873fb1f9ea9fed0ca86addcfcec7722200ed3484c69 Deleted: sha256:d95efe864c7096c38757b80fddad12819fffd68ac3cc73333ebffaa42385fded
Force deleting a list of images (exclure version 10, for example)
The answer here is to find all descendent children, which has an answer here:
docker how can I get the list of dependent child images?
Then use that to remove the child images in order.
Building on Simon Brady's brute force method here, if you don't have a ton of images you can use this shell function:
and then call it using
recursive_remove_image <image-id>
.Here's a script to remove an image and all the images that depend on it.
I also got this issue, I could resolve issue with below commands. this may be cause, the image's container is running or exit so before remove image you need to remove container
docker ps -a -f status=exited : this command shows all the exited containers so then copy container Id and then run below commands to remove container
docker rm #containerId : this command remove container this may be issue that mention "image has dependent child images"
Then try to remove image with below command
docker rmi #ImageId