Cannot delete images as there are child object
What can I do to delete old images -
root@pls10-portals.exp.quad.local ~ $ docker images -a
REPOSITORY TAG IMAGE ID CREATED SIZE
integratorprod_integrator-prod latest 68e4fb412c80 3 days ago 705MB
bb6b49925a48 3 days ago 705MB
8adaee14da9b 3 days ago 705MB
6dcb838848f0 3 days ago 674MB
dockerized/pls-integration latest f161f4ae96aa 3 days ago 705MB
0e222ff14bea 3 days ago 705MB
22b28806ef55 3 days ago 705MB
ec17e5e7d9b8 3 days ago 674MB
53aa1b6d93f7 3 days ago 643MB
bfac113eaad4 3 days ago 643MB
f5626b780ecc 3 days ago 643MB
customerprod_custportal-prod latest 0078c0aff0b5 4 days ago 747MB
25724f72b527 4 days ago 747MB
7c249eadc175 4 days ago 747MB
6d23505caf3b 4 days ago 695MB
java 8 d23bdf5b1b1b 4 years ago 643MB
root@pls10-portals.exp.quad.local ~ $ docker rmi -f 6d23505caf3b
Error response from daemon: conflict: unable to delete 6d23505caf3b (cannot be forced) - image has dependent child images
root@pls10-portals.exp.quad.local ~ $
Is this because the java image is running and ties to all the others?
Docker chews up all my root disk space. ( I did not install this server BTW)
I cannot delete anything as root and this is sup annoying.
Remove dangling images
docker rmi -f $(docker images -f “dangling=true” -q)
Prune unused images
docker image prune -a
What about the images already running?
I ran that command but it didn’t do anything.
Am I supposed to stop the running images first?
When I try to delete them manually, it says there’s a child process running and won’t let me.
Same with the child process I found under here-
/var/lib/docker/image/overlay/imagedb/content/sha256
Nothing will delete , I feel like the java process has to be stopeed as its probably tied to every running container.
But I don’t know.
stop and remove running containers. Try to remove parent image. All child images will be removed. After that remove dangling images. ‘docker image prune -a’ command will remove all unused images with all tags.