I installed a docker image with OS of about a GB in my system and then I updated and installed additional software which pushed the size to almost 2 GB. I used this container to create a new child image by docker commit <cont-id> <child-name>
. Now I have two docker images with both parent and child images totalling to 3 GB. As I have a redundant 1 GB of parent image I want to remove it.
Parent image 1 GB
Child image 2 GB
I tried to keep the child image and tried to remove parent image by docker rmi -f <image-id>
but its giving this error
Error response from daemon: conflict: unable to delete 5dvd3054h756 (cannot be forced) - image has dependent child images
Then tried this solution, I tried sudo docker images --filter "dangling=true" -q --no-trunc
but returned nothing and also tried docker system prune
which shows 0 GB.
I am also planning to install other programs to the OS inside docker and thus want to spawn new child images from existing child images. I searched everywhere and there is no good solution to delete a parent image in docker and the reason I read because of some parent layers being used by child images. Is there no way to delete a parent image in docker after spawning a new child image?