-
Notifications
You must be signed in to change notification settings - Fork 785
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ARG inheritance works in Docker, but not Podman #5762
Comments
A friendly reminder that this issue had no activity for 30 days. |
Update: The Docker documentation was amended by moby/buildkit#5381 and no longer shows contradictory information. Podman buildah should be updated to support argument inheritance in the same way as Docker buildkit. |
Interested in opening a PR? |
Interested, yes, but I'm not familiar with the Podman source code and have no idea where to start. |
The place to start would be Buildah not Podman, Podman vendors in buildah to do all of its container image building. Buildah is a smaller code base. |
As far as I can see, arguments are resolved in https://github.com/openshift/imagebuilder/blob/master/builder.go#L290 per stage. As buildah seems to defer to openshift/imagebuilder to do all the heavy lifting, should I open an issue (or possibly PR) on this repository instead? |
I expect the fix would eventually be made there, yes. |
This looks much more complicated after all. I suppose it would be better to not try to resolve arguments during initial parsing, but record resolved arguments on the fly and them make them available to dependent build stages.
This requires that child stages must wait until their parent finishes, but from what I can see in https://github.com/containers/buildah/blob/main/imagebuildah/executor.go#L908 , they would all run in parallel, and it's not obvious to me how dependencies between stages are guaranteed? Could you help explain how this works? |
Ok, so... processed arguments are already recorded in Proposal:
Edit: I submitted a PR based on this idea from my personal GH account. It's completely untested and needs some finetuning. |
A friendly reminder that this issue had no activity for 30 days. |
Description
Docker provides limited inheritance of Dockerfile ARGs between build stages, as described here: https://docs.docker.com/build/building/variables/#scoping
This contradicts the Dockerfile reference https://docs.docker.com/reference/dockerfile/#scope - which states:
Podman behaves according to the latter statement, making the examples given in the other document incompatible.
Steps to reproduce the issue:
Try to build a Containerfile with the following contents (copied from the Docker manual):
Describe the results you received:
podman build
prints:Describe the results you expected:
docker build
would print:Output of
rpm -q buildah
orapt list buildah
:Output of
buildah version
:Output of
podman version
if reporting apodman build
issue:Output of
cat /etc/*release
:Output of
uname -a
:Output of
cat /etc/containers/storage.conf
:The text was updated successfully, but these errors were encountered: