Today, I can’t delete docker images with dependent child images. How to delete docker image with dependent child images.
I want to delete image e16184e8dd39
[vagrant@localhost docker-flask-app]$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE python 3.6 e16184e8dd39 9 days ago 902MB mysql 5.7 938b57d64674 2 weeks ago 448MB docker-flask-app_app latest 44ae2f35ec29 3 weeks ago 915MB <none> <none> 0e0359a5ec25 3 weeks ago 908MB <none> <none> 3a59efe32b9c 3 weeks ago 908MB postgres latest 6ce504119cc8 5 weeks ago 374MB odoo 14 4f53998176ca 5 weeks ago 1.41GB postgres <none> 346c7820a8fb 2 months ago 315MB
I am trying with command as below
sudo docker rmi e16184e8dd39
Error delete docker image with dependent child images
[vagrant@localhost docker-flask-app]$ sudo docker rmi e16184e8dd39 Error response from daemon: conflict: unable to delete e16184e8dd39 (cannot be forced) - image has dependent child images [vagrant@localhost docker-flask-app]$
I can not delete an image with the -f flag.
How to Fixed it
You should try to remove unnecessary images before removing the image:
[vagrant@localhost docker-flask-app]$ docker rmi $(docker images -q) -f
The output terminal as below
Note: This command above will remove images all.
After you remove the image.
docker rmi -f e16184e8dd39
You have to delete the docker image with dependent child images I hope will this your helpful. Thank you for reading the DevopsRoles page!