-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFD: allow parent images to be removed (with --force) #30722
Comments
Would we remove the whole parent chain up to that deleted image then? That may be bit unexpected but if we don't do it then every deletion possibly creates a new dangling image. |
Good point, I think for any direct descendant of that image, that would be the case yes |
Looks like this already works if buildkit is enabled, so only an issue if images are built with the classic builder (edited the example steps to use BuildKit doesn't set the "Parent" chain; When built with docker inspect --format '{{json .Parent}}' child
"" When built with docker inspect --format '{{json .Parent}}' child
"sha256:9adebf3f78911d6050aff78e1bf2815c9beabea4fea0848b3ed77679fdefeb94" |
For historical reasons, the local image store still has code in place to disallow removing "parent" images.
For example;
Since the introduction of the content-addressable store, the "child/parent" chain
is only used for the local build cache, but is not required to run an image.
I think we should allow removing the parent image if
--force
is used.Note that removing the parent image will not cleanup any disk space (because
the layers are still used by the child image), however it does allow users
to clean up images they no longer need.
related discussion #25602
/cc @tonistiigi @dmcgowan
The text was updated successfully, but these errors were encountered: