Skip to content
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

.dockerignore not working as expected in Podman 1.6.2 #2060

Closed
TomSweeneyRedHat opened this issue Jan 3, 2020 · 3 comments
Closed

.dockerignore not working as expected in Podman 1.6.2 #2060

TomSweeneyRedHat opened this issue Jan 3, 2020 · 3 comments

Comments

@TomSweeneyRedHat
Copy link
Member

As reported by Robert Day in the podman.io mailing list on Jan 3, 2019:

On Fri, 3 Jan 2020, Robert P. J. Day wrote:

almost certainly a dumb question, but i'm unclear on how
.dockerignore interacts with podman in the sense of not passing
certain objects as part of the "build context."

with docker, entries in .dockerignore are explicitly not added to
the context passed to the daemon, so any attempt to, say, COPY or ADD
ignored entries in the Dockerfile are doomed to failure. i tested this
first with docker (on ubuntu) by copying /etc/{passwd,group} to a
build directory, with a Dockerfile that did:

COPY passwd group /

and that worked fine. when i added in .dockerignore the single line

passwd

predictably, the COPY failed not being able to find passwd. so far, so
good.

when i tried the same on fedora 31 with podman 1.6.2, the COPY
worked fine. my early assumption was that podman would ignore
.dockerignore since there is no daemon to which to send the bundled
context, but i've also read elsewhere that podman does something
with .dockerignore, although i'm not sure what. and "man podman-build"
makes no mention of .dockerignore.

just to be clear, i understand the value of .dockerignore when
using docker, given how the build context is bundled and sent to the
daemon. it's not clear what value this has WRT podman, which has no
such daemon.

more to the point, as long as i did my testing correctly, this means
that you will get different results in building using docker versus
using podman -- docker will fail if asked to ADD or COPY a file that
was explicitly .dockerignore'd, while podman will (apparently)
succeed.

in any event, i downloaded the buildah source and noticed numerous
references to ".dockerignore", so it's clear that something is being
done with that file, i just don't know what, and i haven't seen any
useful documentation clarifying that.

rday


Podman mailing list -- podman@lists.podman.io
To unsubscribe send an email to podman-leave@lists.podman.io

@TomSweeneyRedHat
Copy link
Member Author

@QiWang19 PTAL

@QiWang19
Copy link
Collaborator

QiWang19 commented Jan 6, 2020

from the buildah code it checks the .dockerignore only when the source of COPY is a directory

@TomSweeneyRedHat
Copy link
Member Author

Closing this issue as it was addressed with Qi's fixes.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants