Replies: 1 comment 1 reply
-
Note this is tracked as issue in containers/buildah#4242 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was a bit surprised to find that the layers from a built container have the dirs that are mounted in by the container runtime like
proc run sys
and sometimesetc
.This script demonstrates the behavior, both with and without
--dns=none --no-hosts --no-hostname
to showetc
(I originally thought this wasn't working to excludeetc
butpodman build
will reuse the build cache even when it gets different arguments so I was thrown off at first)The base layer (0) is not shown.
The first layer has
etc/{hostname,hosts,resolv.conf} proc run sys
and the remainder of the layers have arun
dir (this holds for more layers in my testing). My assumption going in was that they would only contain the files/dirs that theRUN
statement touches, and not anything from the container runtime. Interesting to note thathostname
et al are 0 length.I presume this is from those dirs being mounted in (and I guess more specifically those dirs have to be created in the workdir of the overlay to then get mounted in; not sure though why only
run
appears in all of them but not the other mount dirs)Overall I'm just wondering if this is known/expected behavior and/or if other container runtimes/builders exhibit the same behavior (I will try to do some testing when I get a chance). And does the OCI spec have anything to say about this? I'm coming at this from a reproducibility standpoint so having these container runtime artifacts appear is not ideal.
UPDATE: I tested with both docker in container, docker out of container, and buildkit and get different results from all of them.
Beta Was this translation helpful? Give feedback.
All reactions