-
Notifications
You must be signed in to change notification settings - Fork 786
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
Podman doesn't pass ARG to ENV #2345
Comments
Adding an additional line:
makes it work, but this is not my Dockerfile so changing it isn't really an option. |
@tachoknight thanks for the report. I think this may be related to #2323. |
If the Dockerfile has a `ARG CHOWN_VAL=6173:6173`, then a `COPY --chown=${CHOWN_VAL} srcFile destFile` will fail. However if the Dockerfile has a `ENV CHOWN_VAL=6173:6173` then it succeeds. The dispatchCopy() function was only going through the list of Environment variables to resolve a Variable instead of the list of Args and Environment variables. If there's a trailing equal `=` sign in the arg, assume that we'd a variable that did not resolve and try to resolve from the list of args. At some point I'd like to look into converting the b.Env to a Map from a slice like b.Args, but didn't want to run this down now. Fixes: containers/buildah#2192 and probably containers/buildah#2345 Signed-off-by: TomSweeneyRedHat <[email protected]>
If the Dockerfile has a `ARG CHOWN_VAL=6173:6173`, then a `COPY --chown=${CHOWN_VAL} srcFile destFile` will fail. However if the Dockerfile has a `ENV CHOWN_VAL=6173:6173` then it succeeds. The dispatchCopy() and add() functions were only going through the list of Environment variables to resolve a Variable instead of the list of Args and Environment variables. If there's a trailing equal `=` sign in the arg, assume that we'd a variable that did not resolve and try to resolve from the list of args. At some point I'd like to look into converting the b.Env to a Map from a slice like b.Args, but didn't want to run this down now. Fixes: containers/buildah#2192 and probably containers/buildah#2345 Signed-off-by: TomSweeneyRedHat <[email protected]>
If the Dockerfile has a `ARG CHOWN_VAL=6173:6173`, then a `COPY --chown=${CHOWN_VAL} srcFile destFile` will fail. However if the Dockerfile has a `ENV CHOWN_VAL=6173:6173` then it succeeds. The dispatchCopy() and add() functions were only going through the list of Environment variables to resolve a Variable instead of the list of Args and Environment variables. Now add the definitions from the ARG statements to the ones from the ENV statements and use both when resolving variables. At some point I'd like to look into converting the b.Env to a Map from a slice like b.Args, but didn't want to run this down now. Fixes: containers/buildah#2192 and probably containers/buildah#2345 Signed-off-by: TomSweeneyRedHat <[email protected]>
If the Dockerfile has a `ARG CHOWN_VAL=6173:6173`, then a `COPY --chown=${CHOWN_VAL} srcFile destFile` will fail. However if the Dockerfile has a `ENV CHOWN_VAL=6173:6173` then it succeeds. The dispatchCopy() and add() functions were only going through the list of Environment variables to resolve a Variable instead of the list of Args and Environment variables. Now add the definitions from the ARG statements to the ones from the ENV statements and use both when resolving variables. At some point I'd like to look into converting the b.Env to a Map from a slice like b.Args, but didn't want to run this down now. Fixes: containers/buildah#2192 and probably containers/buildah#2345 Signed-off-by: TomSweeneyRedHat <[email protected]>
If the Dockerfile has a `ARG CHOWN_VAL=6173:6173`, then a `COPY --chown=${CHOWN_VAL} srcFile destFile` will fail. However if the Dockerfile has a `ENV CHOWN_VAL=6173:6173` then it succeeds. The dispatchCopy() and add() functions were only going through the list of Environment variables to resolve a Variable instead of the list of Args and Environment variables. Now add the definitions from the ARG statements to the ones from the ENV statements and use both when resolving variables. At some point I'd like to look into converting the b.Env to a Map from a slice like b.Args, but didn't want to run this down now. Fixes: containers/buildah#2192 and probably containers/buildah#2345 Signed-off-by: TomSweeneyRedHat <[email protected]>
Bump imagebuilder to the latest upstream to get the ARG fix from openshift/imagebuilder#159 Also touched up the install.md with vendoring from a commitId so I won't have to run all around looking for it next time. Fixes: containers#2192 and probably containers#2345 Signed-off-by: TomSweeneyRedHat <[email protected]>
Bump imagebuilder to the latest upstream to get the ARG fix from openshift/imagebuilder#159 Also touched up the install.md with vendoring from a commitId so I won't have to run all around looking for it next time. Fixes: containers#2192 and probably containers#2345 Signed-off-by: TomSweeneyRedHat <[email protected]>
2373: Bump imagebuilder for ARG fix r=giuseppe a=TomSweeneyRedHat Bump imagebuilder to the latest upstream to get the ARG fix from openshift/imagebuilder#159 Also touched up the install.md with vendoring from a commitId so I won't have to run all around looking for it next time. Fixes: #2192 and probably #2345 Signed-off-by: TomSweeneyRedHat <[email protected]> <!-- Thanks for sending a pull request! Please make sure you've read and understood our contributing guidelines (https://github.com/containers/buildah/blob/master/CONTRIBUTING.md) as well as ensuring that all your commits are signed with `git commit -s`. --> #### What type of PR is this? <!-- Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. Uncomment only one `/kind <>` line, hit enter to put that in a new line, and remove leading whitespace from that line: --> > /kind api-change > /kind bug > /kind cleanup > /kind deprecation > /kind design > /kind documentation > /kind failing-test > /kind feature > /kind flake > /kind other #### What this PR does / why we need it: #### How to verify it #### Which issue(s) this PR fixes: <!-- Automatically closes linked issue when PR is merged. Uncomment the following comment block and include the issue number or None on one line. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`, or `None`. --> <!-- Fixes # or None --> #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? <!-- If no, just write `None` in the release-note block below. If yes, a release note is required: Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". For more information on release notes please follow the kubernetes model: https://git.k8s.io/community/contributors/guide/release-notes.md --> ```release-note ``` Co-authored-by: TomSweeneyRedHat <[email protected]>
2373: Bump imagebuilder for ARG fix r=giuseppe a=TomSweeneyRedHat Bump imagebuilder to the latest upstream to get the ARG fix from openshift/imagebuilder#159 Also touched up the install.md with vendoring from a commitId so I won't have to run all around looking for it next time. Fixes: #2192 and probably #2345 Signed-off-by: TomSweeneyRedHat <[email protected]> <!-- Thanks for sending a pull request! Please make sure you've read and understood our contributing guidelines (https://github.com/containers/buildah/blob/master/CONTRIBUTING.md) as well as ensuring that all your commits are signed with `git commit -s`. --> #### What type of PR is this? <!-- Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. Uncomment only one `/kind <>` line, hit enter to put that in a new line, and remove leading whitespace from that line: --> > /kind api-change > /kind bug > /kind cleanup > /kind deprecation > /kind design > /kind documentation > /kind failing-test > /kind feature > /kind flake > /kind other #### What this PR does / why we need it: #### How to verify it #### Which issue(s) this PR fixes: <!-- Automatically closes linked issue when PR is merged. Uncomment the following comment block and include the issue number or None on one line. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`, or `None`. --> <!-- Fixes # or None --> #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? <!-- If no, just write `None` in the release-note block below. If yes, a release note is required: Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". For more information on release notes please follow the kubernetes model: https://git.k8s.io/community/contributors/guide/release-notes.md --> ```release-note ``` Co-authored-by: TomSweeneyRedHat <[email protected]>
2373: Bump imagebuilder for ARG fix r=giuseppe a=TomSweeneyRedHat Bump imagebuilder to the latest upstream to get the ARG fix from openshift/imagebuilder#159 Also touched up the install.md with vendoring from a commitId so I won't have to run all around looking for it next time. Fixes: #2192 and probably #2345 Signed-off-by: TomSweeneyRedHat <[email protected]> <!-- Thanks for sending a pull request! Please make sure you've read and understood our contributing guidelines (https://github.com/containers/buildah/blob/master/CONTRIBUTING.md) as well as ensuring that all your commits are signed with `git commit -s`. --> #### What type of PR is this? <!-- Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. Uncomment only one `/kind <>` line, hit enter to put that in a new line, and remove leading whitespace from that line: --> > /kind api-change > /kind bug > /kind cleanup > /kind deprecation > /kind design > /kind documentation > /kind failing-test > /kind feature > /kind flake > /kind other #### What this PR does / why we need it: #### How to verify it #### Which issue(s) this PR fixes: <!-- Automatically closes linked issue when PR is merged. Uncomment the following comment block and include the issue number or None on one line. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`, or `None`. --> <!-- Fixes # or None --> #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? <!-- If no, just write `None` in the release-note block below. If yes, a release note is required: Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". For more information on release notes please follow the kubernetes model: https://git.k8s.io/community/contributors/guide/release-notes.md --> ```release-note ``` Co-authored-by: TomSweeneyRedHat <[email protected]>
@tachoknight unfortunately the other PR did not fix this issue. While testing with this further today, I found what's happening. The issue is you have an |
@TomSweeneyRedHat That does seem to work:
where I modified the Dockerfile to look like:
|
@tachoknight TYVM for the test and results. I'm glad that works for you too. I ran into unrelated issues last night on my test machine, hope to dig further through the ENV/ARG handling code there later today. I've a suspicion of where the issue is, but haven't been able to test it out yet. |
A recent update to the argument handling didn't increase the argument slice to take into the account the values from b.Args() that were now being added. The created unpredicatble results. After addressing a comment from @nalind, I realized that the value from b.Arguments should be used in the steps as it keeps the ordering of when the ARGS and ENV were defined in the Dockerfile. Changed makeUserArgs in internals.go to take two variables rather than just a builder. Adddresses the Buildah bug: containers/buildah#2345 Signed-off-by: TomSweeneyRedHat <[email protected]>
We recently made a couple of commits to the imagebuilder project to address containers#2345 and containers#2192. Tests were created in that project, but I thought it best to add some regression tests here in Buildah too. FYI: @petr-motejlek and @tachoknight Signed-off-by: TomSweeneyRedHat <[email protected]>
We recently made a couple of commits to the imagebuilder project to address containers#2345 and containers#2192. Tests were created in that project, but I thought it best to add some regression tests here in Buildah too. FYI: @petr-motejlek and @tachoknight Signed-off-by: TomSweeneyRedHat <[email protected]>
2418: buildah, bud: support --jobs=N for parallel execution r=rhatdan a=giuseppe <!-- Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. Uncomment only one `/kind <>` line, hit enter to put that in a new line, and remove leading whitespace from that line: --> /kind feature #### What this PR does / why we need it: it enables running multi stages Containerfiles in parallel #### How to verify it buildah bud --jobs=$(nproc) ..... #### Which issue(s) this PR fixes: None #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note add support for running multi stages Containerfiles in parallel ``` 2422: Add bud regression tests r=rhatdan a=TomSweeneyRedHat We recently made a couple of commits to the imagebuilder project to address #2345 and #2192. Tests were created in that project, but I thought it best to add some regression tests here in Buildah too. FYI: @petr-motejlek and @tachoknight Signed-off-by: TomSweeneyRedHat <[email protected]> <!-- Thanks for sending a pull request! Please make sure you've read and understood our contributing guidelines (https://github.com/containers/buildah/blob/master/CONTRIBUTING.md) as well as ensuring that all your commits are signed with `git commit -s`. --> #### What type of PR is this? <!-- Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. Uncomment only one `/kind <>` line, hit enter to put that in a new line, and remove leading whitespace from that line: --> > /kind api-change > /kind bug > /kind cleanup > /kind deprecation > /kind design > /kind documentation > /kind failing-test > /kind feature > /kind flake > /kind other #### What this PR does / why we need it: #### How to verify it #### Which issue(s) this PR fixes: <!-- Automatically closes linked issue when PR is merged. Uncomment the following comment block and include the issue number or None on one line. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`, or `None`. --> <!-- Fixes # or None --> #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? <!-- If no, just write `None` in the release-note block below. If yes, a release note is required: Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". For more information on release notes please follow the kubernetes model: https://git.k8s.io/community/contributors/guide/release-notes.md --> ```release-note ``` Co-authored-by: Giuseppe Scrivano <[email protected]> Co-authored-by: TomSweeneyRedHat <[email protected]>
2422: Add bud regression tests r=rhatdan a=TomSweeneyRedHat We recently made a couple of commits to the imagebuilder project to address #2345 and #2192. Tests were created in that project, but I thought it best to add some regression tests here in Buildah too. FYI: @petr-motejlek and @tachoknight Signed-off-by: TomSweeneyRedHat <[email protected]> <!-- Thanks for sending a pull request! Please make sure you've read and understood our contributing guidelines (https://github.com/containers/buildah/blob/master/CONTRIBUTING.md) as well as ensuring that all your commits are signed with `git commit -s`. --> #### What type of PR is this? <!-- Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. Uncomment only one `/kind <>` line, hit enter to put that in a new line, and remove leading whitespace from that line: --> > /kind api-change > /kind bug > /kind cleanup > /kind deprecation > /kind design > /kind documentation > /kind failing-test > /kind feature > /kind flake > /kind other #### What this PR does / why we need it: #### How to verify it #### Which issue(s) this PR fixes: <!-- Automatically closes linked issue when PR is merged. Uncomment the following comment block and include the issue number or None on one line. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`, or `None`. --> <!-- Fixes # or None --> #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? <!-- If no, just write `None` in the release-note block below. If yes, a release note is required: Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". For more information on release notes please follow the kubernetes model: https://git.k8s.io/community/contributors/guide/release-notes.md --> ```release-note ``` Co-authored-by: TomSweeneyRedHat <[email protected]>
It looks like this is fixed in upstream. Reopen if I am mistaken. |
Description
Aloha! When trying to build an image via Podman (it was the Podman repo that sent me here), I have found that
ARG
values do not get passed toENV
in the Dockerfile. This does work with Docker.I am using Podman 1.9.1 on a new installation of Fedora 32. Buildah version is 1.14.8 (both installed via
dnf
).Steps to reproduce the issue:
docker build -f ./Dockerfile . -t "nothing:nothing"
Describe the results you received:
Note that the result of the echo is https://example.org//latest-build.yml
Describe the results you expected:
When run using Docker:
The result of the echo correct: https://example.org/bar/latest-build.yml
Output of
buildah version
:buildah-1.14.8-1.fc32.x86_64
Output of
podman version
if reporting apodman build
issue:podman version 1.9.1
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: