You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Have the following files locally available:
Dockerfile
FROM jenkins/jenkins:2.490
USER root
RUN chgrp -R root /var/jenkins_home/
COPY foo.txt /var/jenkins_home
RUN cat /var/jenkins_home/foo.txt
foo.txt
just a test file
Note that the /var/jenkins_home folder is declared as a volume in the FROM image. If the same was done, say with the /tmp folder COPY would work.
Build with buildah bud: buildah bud -t test .
Result
STEP 1/5: FROM jenkins/jenkins:2.490
STEP 2/5: USER root
STEP 3/5: RUN chgrp -R root /var/jenkins_home/
STEP 4/5: COPY foo.txt /var/jenkins_home
STEP 5/5: RUN cat /var/jenkins_home/foo.txt
cat: /var/jenkins_home/foo.txt: No such file or directory
Error: building at STEP "RUN cat /var/jenkins_home/foo.txt": while running runtime: exit status 1
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:
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: