-
Notifications
You must be signed in to change notification settings - Fork 1.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
COPY --link still invalidates cache of successor COPY --link #5297
Comments
Do you have commands to replicate this from start to finish? What installation of buildkit was this? Note that buildkit embedded into |
Sorry @tonistiigi for the super-slow feedback on my side. A short repro: mkdir foo bar
touch foo/foo bar/bar
cat > Dockerfile <<HERE
FROM scratch
COPY --link --from=foo / /
COPY --link --from=bar / /
HERE Build and populate cache. docker build --progress plain --build-context foo=foo --build-context bar=bar . Now, change the foo context touch foo/baz This will invalidate both COPY statements in the build: docker build --progress plain --build-context foo=foo --build-context bar=bar . |
The Eg. if you change to
Run once, then look up the cache record for
Delete this record |
So the step 8-19 are actually ONE thing happening taking 0.1 seconds in total and not 0.1 seconds per step? Because there is a big difference, these 0.1 seconds adds up if have have 10..100 stages or contexts in my build. |
I am building an image by assembling it from parts using COPY.
The final assembly is simply a list of
COPY --link --from=...
statements likeSuppose I now change the
findutils
image, I see this in the build log:Why would the COPY commands below the find be invalidated? They are simply going to be merged at the end of the build stage so I don't see why it would matter or not.
The text was updated successfully, but these errors were encountered: