Bug 1843405
| Summary: | Dockerfile builds ignore preamble build args | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | OpenShift BugZilla Robot <openshift-bugzilla-robot> |
| Component: | Build | Assignee: | Nalin Dahyabhai <nalin> |
| Status: | CLOSED ERRATA | QA Contact: | wewang <wewang> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 4.4 | CC: | adam.kaplan, aos-bugs, wzheng |
| Target Milestone: | --- | ||
| Target Release: | 4.5.z | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
Previously, if a Dockerfile used in Docker strategy builds used the ARG instruction to define build arguments before the first FROM instruction occurred in the Dockerfile, that instruction would be dropped when the Dockerfile was preprocessed to incorporate any overrides which might have been specified in the Build or BuildConfig. References to those arguments would subsequently not be resolved properly while building an image using the preprocessed Dockerfile.
The preprocessing logic has been modified so that it preserves ARG instructions which are encountered before the first FROM instruction when generating the updated Dockerfile contents, so this problem should no longer occur.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-08-10 13:50:20 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: | 1842982 | ||
| Bug Blocks: | |||
|
Description
OpenShift BugZilla Robot
2020-06-03 09:02:39 UTC
Now latest payload is 4.5.0-0.nightly-2020-07-29-230326, should wait newer payload with the pr merged. Verified in version:
4.5.0-0.nightly-2020-07-30-020337
Steps:
1. Create a bc:
```
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
name: dropped-build-arg
spec:
source:
dockerfile: |-
ARG foo=centos
FROM registry.redhat.io/ubi8/ubi:latest
RUN echo "hello from ubi!"
FROM $foo
RUN echo "hello from $foo"
type: Dockerfile
strategy:
dockerStrategy: {}
type: Docker
```
2. Start build with bc, build complete
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 (OpenShift Container Platform 4.5.5 bug fix update), 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:3188 |