Hi Robert, I seem to recall a fix with .dockerignore went in just after 1.6.2 was released. In theory the behaviour should mimic the Docker behaviour. I believe this is working better (correctly?) in the latest upstream version of Podman, but I don't have an easy way to test that at the moment. I've created an issue against Buildah (which does the build work for Podman) and we'll verify and/or fix that as necessary. That issue is at: https://github.com/containers/buildah/issues/2060 Thanks for the feedback on the User doc too. The .dockerignore functionality is definitely a place we need to beef up the doc. I've spun up a separate Issue here: https://github.com/containers/buildah/issues/2061 t On Fri, Jan 3, 2020 at 5:56 AM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
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