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