Skip to content
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: --build-arg detection not working in multistage builds #1463

Closed
h-vetinari opened this issue Apr 1, 2019 · 5 comments
Closed

BUG: --build-arg detection not working in multistage builds #1463

h-vetinari opened this issue Apr 1, 2019 · 5 comments

Comments

@h-vetinari
Copy link

h-vetinari commented Apr 1, 2019

[Continuing from #1456; containers/podman#2250]

Assume I have a toy dockerfile, say podman_test.dockrf:

FROM docker.io/library/ubuntu:bionic as base
# FROM docker.io/library/ubuntu:bionic as base2

ARG TEST_ARG

RUN if [ $TEST_ARG = "TRUE" ]; then \
    apt-get update ; \
    apt-get install curl -y ; \
    fi

CMD ["bash"]

then everything builds fine (aside from the tagging issue #1456) with

sudo podman build -t podman_test --build-arg TEST_ARG=TRUE -f podman_test.dockrf .

But if the second line is uncommented, I get a spurious warning about:

[Warning] One or more build-args [TEST_ARG] were not consumed

Starting to ignore this warning is obviously risky business, as it would be easily possible to miss cases where it is actually missing (in this case, leaving out --build-arg TEST_ARG=TRUE would result in a single line /bin/sh: 1: [: =: unexpected operator, that's easy to overlook in the build log).

@TomSweeneyRedHat
Copy link
Member

@h-vetinari just to make sure we're on the same page, you said "But if the second line is uncommented, ..." and showed an error. The error you received there you got from using the same 'sudo podman build...` command that you've illustrated? I.e. you didn't tweak that any right?

@h-vetinari
Copy link
Author

@TomSweeneyRedHat: @h-vetinari just to make sure we're on the same page, you said "But if the second line is uncommented, ..." and showed an error. The error you received there you got from using the same 'sudo podman build...` command that you've illustrated? I.e. you didn't tweak that any right?

That's exactly right (sorry if I wasn't clear enough), with the sole exception that it does not error the build, but just yields a warning.

@nalind
Copy link
Member

nalind commented Apr 3, 2019

This should have been fixed by #1427.

@rhatdan
Copy link
Member

rhatdan commented Apr 3, 2019

@h-vetinari What version of buildah are you using? Can you check it versus buildah in master? Or buildah 1.7 if you are using an older version.

@h-vetinari
Copy link
Author

@rhatdan @nalind
I had been on the latest ppa:nightly when I filed this. I just updated that again and now it's fixed. Thanks for the prompt reaction!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants