Question: 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.

Answer: 
If you don't have a huge number of images, there's always the brute-force approach:

```
for i in $(docker images -q)
do
    docker history $i | grep -q f50f9524513f && echo $i
done | sort -u

```
Here's a simple way to get a list of child images that are dependent on a parent image:

```sh
image_id=123456789012

docker images -a -q --filter since=$image_id |
xargs docker inspect --format='{{.Id}} {{.Parent}}' |
grep $image_id

```

That will generate a list of child/parent images IDs, for example (truncated for brevity):

```
sha256:abcdefghijkl sha256:123456789012

```

The left side is the child image ID, the right side is parent image ID that we are trying to delete, but it is saying "image has dependent child images". This tells us that `abcdefghijkl` is the child that is dependent on `123456789012`. So we need to first `docker rmi abcdefghijkl`, then you can `docker rmi 123456789012`.

Now, there may be a chain of dependent child images, so you may have to keep repeating to find the last child.