dotnet / docker-tools

This is a repo to house some common tools for our various docker repos.
MIT License
124 stars 46 forks source link

Defer Docker login until just before pulling cached images during build command #1425

Closed lbussell closed 2 months ago

lbussell commented 2 months ago

Fixes #1424

Instead of running BuildImagesAsync() under authentication the whole time, defer login to only when we need to pull cached images in the case of a cache hit. That should be the only place we need credentials during the actual building of images, since we already pulled the base images with PullBaseImagesAsync().

This has the added benefit of running the rest of the build command without any Docker credentials, since they shouldn't be necessary (and should fail the build).

dotnet-issue-labeler[bot] commented 2 months ago

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

dotnet-issue-labeler[bot] commented 2 months ago

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.