Bug 1810174

Summary: buildah is not expanding env vars in file paths
Product: OpenShift Container Platform Reporter: Ben Parees <bparees>
Component: BuildAssignee: Adam Kaplan <adam.kaplan>
Status: CLOSED ERRATA QA Contact: wewang <wewang>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 4.4CC: aos-bugs, bparees, dwalsh, jcantril, jnovy, jokerman, nalin, tsweeney, wjiang, wzheng
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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
Story Points: ---
Clone Of: 1810069
: 1817175 (view as bug list) Environment:
Last Closed: 2020-07-13 17:18:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1817175    

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.

https://access.redhat.com/errata/RHBA-2020:2409