Skip to content
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

Image caching doesn't account for build args #1505

Closed
mthalman opened this issue Nov 22, 2024 · 3 comments
Closed

Image caching doesn't account for build args #1505

mthalman opened this issue Nov 22, 2024 · 3 comments

Comments

@mthalman
Copy link
Member

mthalman commented Nov 22, 2024

Image Builder's image caching logic doesn't account for a Dockerfile having ARG instructions defined which may vary across builds. This can lead to cache hits when a cache miss should occur, which would mean not re-building an image when it should be. This can occur in the following scenario:

  1. Dockerfile commit is the same as the previously published image
  2. Base image digest is the same as the previously published image
  3. The ARG value is different than the value that was used for the previously published image

In order to fix this, it would be necessary to store the ARG values in the image info file that gets stored in https://github.com/dotnet/versions/tree/main/build-info/docker. Then the logic could retrieve those values and compare them to the current value to see whether they're the same or different.

There are currently no practical examples of this issue. All of the usages of ARG amongst our Dockerfiles are essentially statically defined with no intent to change them. However, it may become relevant based on any improvements we decide to make in https://github.com/dotnet/dotnet-buildtools-prereqs-docker to improve maintainability, such as dotnet/dotnet-buildtools-prereqs-docker#1267.

Copy link

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

Copy link

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

@lbussell
Copy link
Contributor

[Triage] Closing as not planned since there isn't currently an issue with this behavior. We should re-open if we decide to use ARGS to accomplish dotnet/dotnet-buildtools-prereqs-docker#1267.

@lbussell lbussell closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in .NET Docker Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants