Skip to content

Instantly share code, notes, and snippets.

@yogeek
Created November 16, 2017 09:19
Show Gist options
  • Save yogeek/e53e9d2e5113d6bac9f24696c62aceb0 to your computer and use it in GitHub Desktop.
Save yogeek/e53e9d2e5113d6bac9f24696c62aceb0 to your computer and use it in GitHub Desktop.
Docker : Find dependent child images
# In case "docker rmi" displaying the following message :
# Error response from daemon: conflict: unable to delete 599a1a74e98d (cannot be forced) - image has dependent child images
IMAGE_ID=xxxx
for i in $(docker images -q)
do
docker history $i | grep -q $IMAGE_ID && echo $i
done | sort -u
# Then "docker rmi" the resulted images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment