Bug 1813387 - Since 4.3, ADD command in Dockerfile builds does not accept URLs
Summary: Since 4.3, ADD command in Dockerfile builds does not accept URLs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 4.3.0
Hardware: x86_64
OS: All
unspecified
high
Target Milestone: ---
: 4.5.0
Assignee: Jindrich Novy
QA Contact: weiwei jiang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-13 16:35 UTC by Deven Phillips
Modified: 2020-07-13 17:20 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-13 17:20:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:20:31 UTC

Internal Links: 1858779

Description Deven Phillips 2020-03-13 16:35:47 UTC
Description of problem:
Dockerfile buildconfig failing with error 

```
Checking jobs which should have an expected phase of Complete...
## START LOGS: jenkins-slave-npm-1
Cloning "https://github.com/redhat-cop/containers-quickstarts.git" ...
	Commit:	edbc058b8d563e21b58ab75f4d9528beba27ea71 (Toolbox - Remove unnecessary helm init command (#306))
	Author:	Tyler Auerbeck <tauerbec>
	Date:	Mon Mar 9 09:59:23 2020 -0400
Replaced Dockerfile FROM image openshift/jenkins-slave-base-centos7:v3.11
Caching blobs under "/var/cache/blobs".

Pulling image openshift/jenkins-slave-base-centos7:v3.11 ...
Getting image source signatures
Copying blob sha256:c89c264e3999f21448b216e0bbfa7c1b54259993d67a8292442a342a81c07521
Copying blob sha256:83bd93b552717a3e13c1b85e8a94660b8811934944b66c225b252114dc0b33c5
Copying blob sha256:71f94c9817dc87b9c59cbb72697d7d09e149736adc89e58db41e2f819fad4cc1
Copying blob sha256:ab5ef0e5819490abe86106fd9f4381123e37a03e80e650be39f7938d30ecb530
Copying blob sha256:9bd424b76c22d2c9cc444d7e412892f22e6013f8f7e8ee140656bd97ba0693f0
Copying blob sha256:3a05f7a129bec6ccb2a6dbc8e4218bc7eab40f68399714e84f0aea26fa33d1ff
Copying config sha256:09f37499394823812b8f415051ba2895040d40b066837b7801693f55e7420539
Writing manifest to image destination
Storing signatures
STEP 1: FROM openshift/jenkins-slave-base-centos7:v3.11
STEP 2: ENV NODEJS_VERSION=10 NPM_CONFIG_PREFIX=$HOME/.npm-global PATH=$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:$PATH CHROME_BIN=/bin/google-chrome
e267aded81447bcbc9d396f64d41b73e3090540c1ac7757f7f752223f33efd74
STEP 3: ADD https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm google-chrome-stable_current_x86_64.rpm
error: build error: error building at STEP "ADD https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm google-chrome-stable_current_x86_64.rpm": source can't be a URL for COPY
## END LOGS: jenkins-slave-npm-1
```

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


How reproducible:
Consistently reproduceable

Steps to Reproduce:
1. Create a Dockerfile BuildConfig which has an `ADD <url> <filename>` step
2. Run the build

Actual results:
Shown above

Expected results:
Build completes successfully

Additional info:

Comment 1 Tom Sweeney 2020-03-13 18:20:23 UTC
This was fixed in Buildah with https://github.com/containers/buildah/pull/2019 which was included in Buildah v1.12.0.  I need to figure out when that landed in which version of OCP.

Comment 10 weiwei jiang 2020-05-15 07:08:19 UTC
Move to verified.

$ oc get clusterversion 
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.5.0-0.nightly-2020-05-14-231228   True        False         4h17m   Cluster version is 4.5.0-0.nightly-2020-05-14-231228

$ oc new-build -D $'FROM busybox     
ADD https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm google-chrome-stable_current_x86_64.rpm' --to=default/add-url
--> Found container image 78096d0 (34 hours old) from Docker Hub for "busybox"

    * An image stream tag will be created as "busybox:latest" that will track the source image
    * A Docker build using a predefined Dockerfile will be created
      * The resulting image will be pushed to image stream tag "add-url:latest"
      * Every time "busybox:latest" changes a new build will be triggered

--> Creating resources with label build=add-url ...
    imagestream.image.openshift.io "busybox" created
    imagestream.image.openshift.io "add-url" created
    buildconfig.build.openshift.io "add-url" created
--> Success

$ oc logs bc/add-url
Replaced Dockerfile FROM image busybox
Caching blobs under "/var/cache/blobs".

Pulling image busybox@sha256:a7766145a775d39e53a713c75b6fd6d318740e70327aaa3ed5d09e0ef33fc3df ...
Getting image source signatures
Copying blob sha256:d9cbbca60e5f0fc028b13c01e70e96cc2eefe7858ccc5a33c9a8faa8b03286aa
Copying config sha256:78096d0a54788961ca68393e5f8038704b97d8af374249dc5c8faec1b8045e42
Writing manifest to image destination
Storing signatures
STEP 1: FROM busybox@sha256:a7766145a775d39e53a713c75b6fd6d318740e70327aaa3ed5d09e0ef33fc3df
STEP 2: ADD https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm google-chrome-stable_current_x86_64.rpm
time="2020-05-15T07:05:36Z" level=info msg="Image operating system mismatch: image uses \"\", expecting \"linux\""
time="2020-05-15T07:05:36Z" level=info msg="Image architecture mismatch: image uses \"\", expecting \"amd64\""
--> c84e36978fa
STEP 3: ENV "OPENSHIFT_BUILD_NAME"="add-url-1" "OPENSHIFT_BUILD_NAMESPACE"="default"
time="2020-05-15T07:05:38Z" level=info msg="Image operating system mismatch: image uses \"\", expecting \"linux\""
time="2020-05-15T07:05:38Z" level=info msg="Image architecture mismatch: image uses \"\", expecting \"amd64\""
--> 9142d31fa32
STEP 4: LABEL "io.openshift.build.name"="add-url-1" "io.openshift.build.namespace"="default"
STEP 5: COMMIT temp.builder.openshift.io/default/add-url-1:d668ee9a
time="2020-05-15T07:05:38Z" level=info msg="Image operating system mismatch: image uses \"\", expecting \"linux\""
time="2020-05-15T07:05:38Z" level=info msg="Image architecture mismatch: image uses \"\", expecting \"amd64\""
--> d4a906ed6dd
d4a906ed6dd6f2abc8e4323ec593ec3f80b62cedb90a8c046aa386746f06796e

Pushing image image-registry.openshift-image-registry.svc:5000/default/add-url:latest ...
Getting image source signatures
Copying blob sha256:ef0ee2b25977a99bf396275c261f86c49b73e7ba5629f380550e492112fdca6d
Copying blob sha256:d9cbbca60e5f0fc028b13c01e70e96cc2eefe7858ccc5a33c9a8faa8b03286aa
Copying config sha256:d4a906ed6dd6f2abc8e4323ec593ec3f80b62cedb90a8c046aa386746f06796e
Writing manifest to image destination
Storing signatures
Successfully pushed image-registry.openshift-image-registry.svc:5000/default/add-url@sha256:278e8445c2ff12bd8cce78d5324a93edfb9e0b0bb304f94dfef85b4b8e644146
Push successful

Comment 12 errata-xmlrpc 2020-07-13 17:20:05 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


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