-
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
Error doing COPY of empty directory in multi-stage build #2964
Comments
We currently are enforcing that the source direcrtory exists, I wonder if that is what broke? @nalind PTAL |
The source directory does exist, though, but we're treating it as an error when we try to copy from a directory to a directory, but the source directory is empty. |
FWIW, we were able to work around it with the kind of obvious fix of:
Since there is always a So that's the workaround - assure that the source folder always has something in it. But this still breaks pattern with docker, which from my testing accepted an empty source folder. Using:
|
Oh, yes, it's a bug, sorry if I wasn't clear on that. |
When a COPY command was being targeted at an empty new directory, the copy would fail. It could be "worked around" by putting a dummy file into the directory. Addresses: containers#2964 Signed-off-by: TomSweeneyRedHat <[email protected]>
When a COPY command was being targeted at an empty new directory, the copy would fail. It could be "worked around" by putting a dummy file into the directory. Addresses: #2964 Signed-off-by: TomSweeneyRedHat <[email protected]>
When a COPY command was being targeted at an empty new directory, the copy would fail. It could be "worked around" by putting a dummy file into the directory. Addresses: containers#2964 Signed-off-by: TomSweeneyRedHat <[email protected]>
When a COPY command was being targeted at an empty new directory, the copy would fail. It could be "worked around" by putting a dummy file into the directory. Addresses: containers#2964 Signed-off-by: TomSweeneyRedHat <[email protected]>
When a COPY command was being targeted at an empty new directory, the copy would fail. It could be "worked around" by putting a dummy file into the directory. Addresses: containers#2964 Signed-off-by: TomSweeneyRedHat <[email protected]> Signed-off-by: Daniel J Walsh <[email protected]>
This is now fixed in the main branch, although it is causing us some other errors that we are working through. |
Reopening as #3002 will revert the change completely and I need to dig further. |
I think this conflicts with what Docker does. That is why everything is blowing up. |
Looks like Docker does NOT blow up with this Dockerfile, which leads me to believe that something might be off either with the dockerignore test, or perhaps the way we process dockerignore files?
|
When a COPY command was being targeted at an empty new directory, the copy would fail. It could be "worked around" by putting a dummy file into the directory. Addresses: containers#2964 Signed-off-by: TomSweeneyRedHat <[email protected]>
When a COPY command was being targeted at an empty new directory, the copy would fail. It could be "worked around" by putting a dummy file into the directory. Addresses: containers#2964 Signed-off-by: TomSweeneyRedHat <[email protected]>
I made a note in the PR, but thought I'd tie up here. The new processing for an emptydir was not checking the |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Our real Containerfile is in the project here:
https://github.com/ansible/awx-ee/blob/devel/Containerfile
My problem is that I can't build it with the relatively recent podman I have on my computer. Older versions seem to be able to build it. The error occurs in a line
COPY --from=galaxy /usr/share/ansible/roles /usr/share/ansible/roles
where/usr/share/ansible/roles
in thegalaxy
image either does't exist, or is empty.Steps to reproduce the issue:
This is a modified version of our Containerfile to demonstrate the issue:
podman build -f Containerfile . -t quay.io/ansible/awx-ee:latest
, passing that ContainerfileDescribe the results you received:
return code:
Describe the results you expected:
Return code of 0.
Additional information you deem important (e.g. issue happens only occasionally):
Issue happens deterministically.
I tinkered with my example Containerfile, found that I could replace the line:
with
And then it worked without error. In other words, the COPY worked when the directory wasn't empty.
Docker doesn't seem have a problem with my example Containerfile.
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: