-
Notifications
You must be signed in to change notification settings - Fork 788
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
buildah bud fails silently when copying file to volume when root #5884
Comments
What version of RHEL is this? Is /var/jenkens_home a volume? If yes could you copy the file to /tmp and see if it shows up? |
Thank you for the answer! I am on RHEL 9.4. I tried copying to /tmp and it works. |
I am guessing /var/jenkens_home is a volume and the file is being copied but the next Run command is not seeing the copied file. In the cast of /tmp, then there is no VOLUME defined. podman image inspect jenkins/jenkins:2.490 Should show you the defined volumes. |
Yep! That is exactly why I mentioned it only is a bug when copying to a volume. I only think it is a bug because I would expect buildah to throw an error or warning when trying to copy something into a volume. If this is the intended behavior, then we can simply close this issue. |
We turned off the "freezing" of volume directories during the build as the default behavior in 1.37, with a |
Description
When copying a local file to a folder declared as a volume in an image using buildah bud as the root user the copy command is silently ignored.
Version
Output of
buildah --version
:buildah version 1.33.7 (image-spec 1.1.0-rc.5, runtime-spec 1.1.0)
Unfortunately can't update, since this is the newest available version I get from RedHat.
To reproduce
Dockerfile
foo.txt
Note that the
/var/jenkins_home
folder is declared as a volume in theFROM
image. If the same was done, say with the/tmp
folderCOPY
would work.buildah bud -t test .
Result
Expected result
I would expect one of the following behaviors (in order of preference):
COPY
fails with an error that says you can't copy to a volume (since it would be overwritten once a volume is actually mounted there)COPY
outputs a warning saying whatever you copy to a volume will be overwritten on mount. But allows the copy to work. This would be acceptable if one knows the file is only needed at build time and can be overwritten at runtime. Looks like a footgun but at least it's a warning.COPY
silently works. Bigger footgun, but still acceptable.What I don't think it is acceptable is to silently fail the
COPY
and simply continue building the next step.Or maybe I'm doing something wrong 😅 If that is the case, please point me in the right direction!
The text was updated successfully, but these errors were encountered: