Bug 1810174 - buildah is not expanding env vars in file paths
Summary: buildah is not expanding env vars in file paths
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 4.4
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.5.0
Assignee: Adam Kaplan
QA Contact: wewang
Depends On:
Blocks: 1817175
TreeView+ depends on / blocked
Reported: 2020-03-04 16:31 UTC by Ben Parees
Modified: 2020-07-13 17:18 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: buildah did not expand variables in Dockerfiles Consequence: builds could fail because variables (ex: ${BAR}) would be interpreted literally Fix: upgraded version of buildah with fix to expand variables in Dockerfile builds Result: builds should succeed if they have an argument like ${BAR} in the Dockerfile
Clone Of: 1810069
: 1817175 (view as bug list)
Last Closed: 2020-07-13 17:18:09 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Github openshift builder pull 141 None closed Bug 1810174: bump github.com/containers/buildah and dependencies 2020-06-30 15:49:29 UTC
Red Hat Product Errata RHBA-2020:2409 None None None 2020-07-13 17:18:34 UTC

Comment 1 Ben Parees 2020-03-04 16:40:46 UTC
once https://bugzilla.redhat.com/show_bug.cgi?id=1810069 is resolved, devex team needs to use this bug to update the deps to pick up the buildah fix.

Comment 6 Ben Parees 2020-03-30 14:18:35 UTC
I don't know that you can get the buildah version (since we're just vendoring buildah code in).

So we'd just have to confirm that the commit that image was built from, included the vendored changes we expect.

But i don't think this was actually a verification failure.  Look at your output:

STEP 3: ADD ./f${foo} /tmp/foo
error: build error: error building at STEP "ADD ./f${foo} /tmp/foo": no files found matching "/tmp/build/inputs/foo": no such file or directory

It resolved the path correctly using the env var substitution ("/tmp/build/inputs/foo").  The reason it failed is you didn't actually provide a "foo" file in your build inputs, not because the path wasn't resolved correctly.

Do this in the directory where you have your dockerfile:

$ touch foo
$ oc start-build --from-dir .

Comment 7 wewang 2020-03-31 06:40:01 UTC
@Ben Now verified in version:4.5.0-0.nightly-2020-03-30-203132, linked case:OCP-28937 and Add test for origin, could you help to review the pr:https://github.com/openshift/origin/pull/24800, thanks.

Comment 8 Adam Kaplan 2020-03-31 19:24:36 UTC
Dropping dependency on the buildah bug fix, as it has already landed.

Comment 10 errata-xmlrpc 2020-07-13 17:18:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.