-
Notifications
You must be signed in to change notification settings - Fork 447
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
[BUG] COPY after VOLUME should be ignored #2357
Comments
I did try to create a volume:
In that case, the documentation holds true and only I think this is the behaviour that the |
If my understanding is correct, then this description should be updated to say that:
|
If it is just a documentation mistake, I think we can just remove the line that says:
I suggest this because when I was browsing the documentaion, I didn't make any assumptions about what happens before or after declaring a Another point: The documentation mentions "any build steps (that) change the data within the volume". |
I think this may be related to a change in behavior between BuildKit and the classic builder; with the classic builder, With BuildKit (now the default), I'm not 100% sure what the behavior is for |
Contributing guidelines
I've found a bug and checked that ...
Description
According to the dockefile VOLUME documentation:
However when we call
COPY
after usingVOLUME
the file is still copied.Not sure where the bug is: Is the implementation wrong? Or is the documentation wrong?
Expected behaviour
COPY
afterVOLUME
should be ignoredActual behaviour
COPY
afterVOLUME
is not ignoredBuildx version
github.com/docker/buildx v0.10.5 86bdced
Docker info
No response
Builders list
Configuration
Dockerfile:
Commands:
docker build -t test .
docker run -dt --name test-container test
docker exec -it test-container
Then, from inside the container:
ls content/
Notice both
file_a
andfile_b
show up. To my understandingfile_b
should have been ignored.Build logs
No response
Additional info
No response
The text was updated successfully, but these errors were encountered: