-
Notifications
You must be signed in to change notification settings - Fork 787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: global ARG not shown as build step #1503
Comments
Looks like this has been fixed. |
@rhatdan The issue is the missing line for the first Compare:
with:
|
@ashley-cui PTAL |
@TomSweeneyRedHat Could you confirm if this is still a bug in v1.9? |
I checked with the newest ubuntu ppa (which already has 1.9.0), and it is still an issue. |
Still an issue in 1.15.0-dev |
This is actually an artifact of how Specifically The resulting image should be correct, but you're right in that I don't have a great solution, but I'm wondering if this is really something that needs to be fixed given that the image is correct. |
It's clearly not a critical issue, but I think |
Could one of you two @carbonin @h-vetinari open a PR to fix this issue? |
Well no one has picked this up and it is not critical, so I will close if no one in community grabs it in the next month, |
Hm, that's IMO not a good reason to close . Yes, criticality is low, but that doesn't mean it shouldn't be fixed eventually. I haven't looked at the buildah-code, but @carbonin's link is to openshift/imagebuilder - is that really the place to change it? |
Most likely yes. So we could open an issue over there. I am not a huge fan of just leaving issues out wasting away on the vine, in the hopes that someone will eventually fix it. But if a fix went into imagebuilder, buildah would use it. |
A friendly reminder that this issue had no activity for 30 days. |
I just noticed this today as well. It is a bit of a hindrance to multistage builds, and contrary to the docker specification on how Here is a simple test: buildah bud --no-cache --build-arg foo=beat -<<'EOF'
ARG foo
FROM alpine:latest as base
ENV foo="${foo:-booze}"
ENV bar="feel the"
FROM base as stage0
RUN echo "$bar" && echo "$foo"
FROM alpine:latest as stage1
RUN echo "$bar" && echo "$foo"
EOF Outputs:
The output from step 8 should have been Thanks |
This issue is specifically about the output from the buildah command as compared to docker. Both tools currently treat multi-stage builds the same for me. Running a docker and buildah build with your Dockerfile proves this out:
I also included my buildah and docker versions for reference. |
@TomSweeneyRedHat Would you take a look at this, you have more experience in this area, then me. |
I am seeing feel the booze from Docker was well
If I move the ARG to after the from, everything works.
|
Finally getting to this, but yes, @rhatdan is correct. The 'FROM' wipes out previous values in |
[Continuing from #1456; containers/podman#2250]
This is a comparatively small bug, but confusing nevertheless. In multistage builds, it may be necessary to re-use a build-arg for different stages (I'm using the generic
DEBIAN_FRONTEND
in the example below), but setting it per stage would lead to an error:ARG requires exactly one argument definition
Docker solves this by being able to specify a global ARG before the first FROM, cf. here. Podman/buildah execute this correctly, but does not show the ARG before the first FROM as a build step.
Say we have the following dockerfile, and call it
podman_test.dockrf
:Then the build log is
where one can see that the variable is inserted into the stages correctly (cf.
RUN echo $DEBIAN_FRONTEND
), but the first step is not shown (as docker does).The text was updated successfully, but these errors were encountered: