-
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
ARG values truncated at '=' when used to set ENV values #2424
Comments
libpod issue containers/podman#6785 |
Belay the above - the podman source includes a snapshot of buildah, rather than fetching buildah as an external module! |
@srcshelton thanks for the issue report. Any chance you could try Podman v2.0.0 or v2.0.1? I don't recall what versions of Buildah went into the 2.0.0.RC# variants, but I do know that we bumped it at one point from 1.14.9 to 1.15-dev. The latest release of Buildah 1.15.0 which went into Podman v2.0.0 should have the latest bits and hopefully works. Way past quitting time here and I'm losing the fight with my eyelids, will try myself in the morning if you don't beat me to it. |
Hadn’t realised there was a v2.0.1, TBH - I’ll build that in the morning! libpod-2.0.0_rc6/buildah-1.15.0-dev worked, libpod-2.0.0_rc7/buildah-1.15.0 & libpod-2.0.0_rc7/buildah-1.15.0 don’t appear to. But I’m afraid that this does look to be an issue with buildah-1.15.0 😔 |
I've just upgraded to libpod-2.0.1 and can confirm that it is also affected by the same issue:
|
@srcshelton thanks for the tests and retests. Drats about it not being cured in the latest. I've been pulled into other fires this morning, will take a look a bit after lunch today. |
I did a recent change here: https://github.com/openshift/imagebuilder/blob/07ab54df11165c27c2c78a85a093d1198d3c030b/internals.go#L106 |
@srcshelton ^^ |
I think you're right: https://github.com/openshift/imagebuilder/blob/07ab54df11165c27c2c78a85a093d1198d3c030b/internals.go#L108 looks as if it keeps the first two args, and discards the remainder - so |
Something along the lines of:
(Disclaimer: I've not written any Go since 2016! ;) |
If an ARG in a Dockerfile looks like this: ARG multivalarg="a=1 b=2 c=3 d=4" the processing would drop everything after the second equal sign leaving multivalarg="a". Addresses: containers/buildah#2424 Signed-off-by: TomSweeneyRedHat <[email protected]>
@srcshelton even simpler I just changed:
to
Which tells golang to create two elements in val, everything to the left of the first equal sign in val[0], everything to the right of it in val[1]. Quick fix, took me about 3 times longer to write the regression test. |
Nice 👍 |
It looks like this is fixed in upstream. Reopen if I am mistaken. |
Reopening as this bug is going on my checklist darn it @rhatdan! |
Description
This is an apparent regression between buildah-1.15.0-dev (libpod-2.0.0_rc6) and buildah-1.15.0 (libpod-2.0.0_rc7):
When an ARG is used to initialise an ENV variable, the ENV value in the resulting image is truncated at the first equals sign.
This doesn't appear to be the same as issue #2345 as the ARG and ENV variable names are different and the value is partially coming through.
Steps to reproduce the issue:
Dockerfile
file with the following content:N.B. This works:
Build the container (
podman build -t test .
);Inspect the image variables (
podman inspect -f '{{ .Config.Env }}' test
):Describe the results you received:
podman-2.0.0_rc6 and previous:
podman-2.0.0_rc7 and later:
Describe the results you expected:
multival=a=1 b=2 c=3 d=4
Output of
rpm -q buildah
orapt list buildah
:n/a (buildah installed as a libpod dependency)
Output of
buildah version
:Output of
podman version
if reporting apodman build
issue:Working:
podman version 2.0.0-rc6
Broken:
podman version 2.0.0-rc7
&podman version 2.0.0
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: