-
Notifications
You must be signed in to change notification settings - Fork 38
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
Always pull the container image #272
base: main
Are you sure you want to change the base?
Conversation
Yes, we could query the registry client and compare the digest of the local manifest and the remote manifest. But that is more complicated than just letting Docker do that for us. It's also relatively quick (compared with overall Dependabot execution) when no newer image is available: Fresh pull: ``` $ time docker pull docker.io/library/alpine:latest latest: Pulling from library/alpine 4abcf2066143: Pull complete Digest: sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b Status: Downloaded newer image for alpine:latest docker.io/library/alpine:latest ________________________________________________________ Executed in 2.10 secs fish external usr time 1.21 millis 0.00 micros 1.21 millis sys time 16.02 millis 203.00 micros 15.82 millis ``` Cached pull: ``` time docker pull docker.io/library/alpine:latest latest: Pulling from library/alpine Digest: sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b Status: Image is up to date for alpine:latest docker.io/library/alpine:latest ________________________________________________________ Executed in 894.23 millis fish external usr time 1.22 millis 0.00 micros 1.22 millis sys time 14.08 millis 240.00 micros 13.84 millis ```
var inspect types.ImageInspect | ||
|
||
// check if image exists locally | ||
inspect, _, err := cli.ImageInspectWithRaw(ctx, image) | ||
|
||
// pull image if necessary | ||
if err != nil { |
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.
This diff is horrible, but I essentially removed these 3 lines and decreased the indentation below.
I just tested this locally, since I build local ARM versions I'd have to remember to add |
No, that's going to add too much complexity IMO. I'll have to do:
|
Yes, we could query the registry client and compare the digest of the local manifest and the remote manifest. But that is more complicated than just letting Docker do that for us. It's also relatively quick (compared with overall Dependabot execution) when no newer image is available:
Fresh pull:
Cached pull: