-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Wildcard in .containerignore combined with containerfile outside of build context leads to an error #20259
Comments
Please remove the machine and create anew one. The version in the machine is way to old. Not sure why this did not get updated. Note sure if this fixes the bug but I remember changes around the remote build part handling so it could be. Also what is you client version as reported by |
I've updated the machine and the task description above. Seems like the issue is a little more common than I previously wrote. Hopefully, the description will be helpful. |
|
As far as I can understand, external containerfiles are getting added to the build context here, but are excluded by pattern matcher later. Maybe one should add containerfile to the dontexcludes even if it's external because of possible wildcards in ignorefile. Out of curiosityWhy does It also strange to me that we're forcing it to be included in context by adding
and file structure like
containerfile (1) has to be included since we're building it, but containerfile (2) is not, because we're ignoring every of them in |
Sounds reasonable. Interested in opening a PR? |
@rhatdan, I added a PR. It includes a few new new lines which are, however, differ from what I described above. Adding "external" file to |
Issue Description
podman build
fails if containerfile is outside of build context and.containerignore
contains something like this:With similar
.containerignore
:Using stdin as input fails
Using containerfile outside of build context fails
Using default containerfile works
Using -f ./Containerfile works
Using -f ./non-standard.containerfile works
Without similar
.containerignore
:Using containerfile outside of build context works
Steps to reproduce the issue
*, !file
.podman build -f
with containerfile outside of build context.Describe the results you received
podman build
fails.Describe the results you expected
podman build
succeeds.podman info output
Data
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
The host is a M1 Pro MacBook.
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
The text was updated successfully, but these errors were encountered: