how does .dockerignore interact with podman?
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. thoughts? rday
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
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
On Fri, 3 Jan 2020, Tom & Susie Sweeney wrote:
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...
ah, so under podman, the .dockerignore file should still reflect what the image builder wants to identify as files/dirs that cannot play any part in the image construction, yes? will there be a generic version of this file that also drops the "docker" appellation ... perhaps ".contextignore"? ".buildignore"? whatever. rday
On 1/3/20 8:20 AM, Robert P. J. Day wrote:
On Fri, 3 Jan 2020, Tom & Susie Sweeney wrote:
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... ah, so under podman, the .dockerignore file should still reflect what the image builder wants to identify as files/dirs that cannot play any part in the image construction, yes?
will there be a generic version of this file that also drops the "docker" appellation ... perhaps ".contextignore"? ".buildignore"? whatever.
rday _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
I don't think we do this yet, but the name we would use would be .containerignore Since we are changing references from Docker->Container as in Dockerfile->Containerfile
Nice to see containerfile is going to happen, that's made my day! On Fri, 3 Jan 2020, 18:01 Daniel Walsh, <dwalsh@redhat.com> wrote:
On 1/3/20 8:20 AM, Robert P. J. Day wrote:
On Fri, 3 Jan 2020, Tom & Susie Sweeney wrote:
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... ah, so under podman, the .dockerignore file should still reflect what the image builder wants to identify as files/dirs that cannot play any part in the image construction, yes?
will there be a generic version of this file that also drops the "docker" appellation ... perhaps ".contextignore"? ".buildignore"? whatever.
rday _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
I don't think we do this yet, but the name we would use would be .containerignore
Since we are changing references from Docker->Container as in Dockerfile->Containerfile
_______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
Containerfile being a thing really makes my day! Thanks for being open to the idea. The Podman community has been a lot more open to ideas more so than certain other container projects.. *cough cough*... Great work everyone! On Fri, Jan 3, 2020, 1:43 PM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
On Fri, 3 Jan 2020, Bryan Hepworth wrote:
Nice to see containerfile is going to happen, that's made my day!
it's already supported.
rday _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
Den 2020-01-03 kl. 11:55, skrev Robert P. J. Day:
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.
I think "podman-remote build" would have a similar issue, over varlink ? To avoid having to package and send any big stuff, over the network... i.e. normally a tarball is created from the local directory, and then sent as a stream to the build command - in this case BuildImage API https://github.com/containers/libpod/blob/master/API.md#BuildImage So it is nice to have the .dockerignore | .containerignore support /Anders
On 01/04/2020 10:21 AM, Anders F Björklund wrote:
Den 2020-01-03 kl. 11:55, skrev Robert P. J. Day:
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. I think "podman-remote build" would have a similar issue, over varlink ? To avoid having to package and send any big stuff, over the network...
i.e. normally a tarball is created from the local directory, and then sent as a stream to the build command - in this case BuildImage API
https://github.com/containers/libpod/blob/master/API.md#BuildImage
So it is nice to have the .dockerignore | .containerignore support
/Anders _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
Just a quick follow up, a fix is in progress for the original posted issue: https://github.com/containers/buildah/pull/2064 t
Teilnehmer (7)
-
Anders F Björklund -
Aric Renzo -
Bryan Hepworth -
Daniel Walsh -
Robert P. J. Day -
Tom & Susie Sweeney -
Tom Sweeney