Bug 1821861 - [4.3] Build incorrectly substitutes "=" for spaces in Dockerfiles
Summary: [4.3] Build incorrectly substitutes "=" for spaces in Dockerfiles
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 4.2.z
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.3.z
Assignee: Adam Kaplan
QA Contact: wewang
Depends On: 1821860
TreeView+ depends on / blocked
Reported: 2020-04-07 18:18 UTC by Adam Kaplan
Modified: 2020-05-11 21:20 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Before starting a build, the OpenShift builder would parse the supplied Dockerfile and reconstruct a modified version of it to use for the build, to add labels and handle substitutions of the images named in FROM instructions. The generated Dockerfile did not always correctly reconstruct ENV and LABEL instructions. Consequence: The generated Dockerfile would sometimes include "=" characters where the original did not, and the build would fail with a syntax error. Fix: When generating the modified Dockerfile, the original text for ENV and LABEL instructions is now used verbatim. Result: The build process should no longer introduce syntax errors in ENV and LABEL instructions.
Clone Of: 1821860
Last Closed: 2020-05-11 21:20:39 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github openshift builder pull 149 0 None closed [release-4.3] Bug 1821861: manage-dockerfile: use the original form of ENV/LABEL 2020-05-13 12:39:55 UTC
Red Hat Product Errata RHBA-2020:2006 0 None None None 2020-05-11 21:20:51 UTC

Description Adam Kaplan 2020-04-07 18:18:08 UTC
+++ This bug was initially created as a clone of Bug #1821860 +++

+++ This bug was initially created as a clone of Bug #1821858 +++

Description of problem:

When rewriting the Dockerfile with our substitutions, we unconditionally insert = characters, even in cases where the original file didn't use them. They're syntactically important, though, so such changes can cause builds to fail. For ENV and LABEL instructions, just emit the original text.

Reported in openshift/origin#24151 [1]. Fixed by openshift/builder#134 [2]

Version-Release number of selected component (if applicable): 4.2.z

How reproducible: Always

Steps to Reproduce:

1. Create Docker fbuild from e.g.
   git url: https://github.com/sonatype/docker-nexus.git
   context dir: /oss
2. Start build

Actual results:

Cloning "https://github.com/sonatype/docker-nexus.git" ...
Commit: b892177cfb8b03d1d37a369b47ec57512051d67b (Update Repository Manager to 2.14.15-01.)
Author: Sonatype sonatype-ci
Date: Tue Oct 15 13:50:45 2019 +0000
Caching blobs under "/var/cache/blobs".
error: build error: Syntax error - can't find = in "./conf/jetty-requestlog.xml". Must be of the form: name=value

Expected results:

Build succeeds

Additional info:

[1] https://github.com/openshift/origin/issues/24151
[2] https://github.com/openshift/builder/pull/134

Comment 3 wewang 2020-04-23 01:02:33 UTC
Pr just merged 3 hours ago, wait latest payload include the pr.

Comment 4 wewang 2020-04-26 02:50:40 UTC
Verified in version:

STEP 17: ENV JAVA_OPTS -server -Djava.net.preferIPv4Stack=true
STEP 18: ENV LAUNCHER_CONF ./conf/jetty.xml ./conf/jetty-requestlog.xml
STEP 19: CMD java   -Dnexus-work=${SONATYPE_WORK} -Dnexus-webapp-context-path=${CONTEXT_PATH}   -Xms${MIN_HEAP} -Xmx${MAX_HEAP}   -cp 'conf/:lib/*'   ${JAVA_OPTS}   org.sonatype.nexus.bootstrap.Launcher ${LAUNCHER_CONF}

Comment 6 errata-xmlrpc 2020-05-11 21:20:39 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.