-
Notifications
You must be signed in to change notification settings - Fork 2k
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
docker: set force=true on remove image to handle images referenced by multiple tags #15962
Conversation
b134dd3
to
1c15877
Compare
… multiple tags This PR changes our call of docker client RemoveImage() to RemoveImageExtended with the Force=true option set. This fixes a bug where an image referenced by more than one tag could never be garbage collected by Nomad. The Force option only applies to stopped containers; it does not affect running workloads.
1c15877
to
4e88d9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Looking at the dockerCoordinator code, I suspect this will subvert the image_delay
when folks have multiple tags on the same image if ref counts for those tags all go to zero within the delay window. But I also think if you care a lot about image_delay
then you are going to care about canonicalizing which image tag you're using?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Indeed, this swaps one bug for another, but I think for the less bad one. With this change there's potential for missed optimization in re-using a downloaded image. Without, images can pile up on a node and require external maintenence as described in #15760. I added a note to the |
This PR changes our call of docker client
RemoveImage()
toRemoveImageExtended
withthe
Force=true
option set. This fixes a bug where an image referenced by more thanone tag could never be garbage collected by Nomad. The Force option only applies to
stopped containers; it does not affect running workloads.
Fixes #15760