dotnet / docker-tools

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

Image caching support for copied local files #1270

Open mthalman opened 2 months ago

mthalman commented 2 months ago

Image Builder's image caching support has the ability to determine that a Dockerfile should be rebuilt if its checksum has changed since it was last published. This checksum comparison is strictly limited to the Dockerfile, however. It doesn't handle cases where the Dockerfile is configured to copy in local files that are operated upon. Any change to those files (and not the Dockerfile) wouldn't trigger the Dockerfile to be rebuilt. There are such cases of Dockerfiles copying in local files in the buildtools-prereqs repo (example).

Image Builder should be updated to account for such file changes so that the Dockerfile can be rebuilt.

I see two options to support this:

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

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 commented 2 months ago

[Triage] We could also consider supporting Docker's caching on linux only, and not support any file-based caching on Windows (continue using our old solution on windows until BuildKit is supported).