Bug 1416456 - BuildConfig with Docker strategy using Dockerfile with 'FROM scratch' results in a failed build
Summary: BuildConfig with Docker strategy using Dockerfile with 'FROM scratch' results...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.4.z
Assignee: Ben Parees
QA Contact: Wang Haoran
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-25 14:42 UTC by Bill DeCoste
Modified: 2017-02-22 18:11 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
If this bug requires documentation, please select an appropriate Doc Type value.
Clone Of:
Environment:
Last Closed: 2017-02-22 18:11:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0289 0 normal SHIPPED_LIVE OpenShift Container Platform 3.4.1.7, 3.3.1.14, and 3.2.1.26 bug fix update 2017-02-22 23:10:04 UTC

Description Bill DeCoste 2017-01-25 14:42:54 UTC
Description of problem:

BuildConfigs using Docker/Dockerfile strategy with FROM scratch causes a build failure: 'scratch' is a reserved name

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


How reproducible:
100%


Steps to Reproduce:
1. Use BuildConfig similar to https://github.com/bdecoste/jdv-jdg-sample/blob/master/datavirt63-jdg-s2i.json#L493
2. BuildConfig points to Dockerfile with 'FROM scratch'
3.

Actual results:
Failed build: 'scratch' is a reserved name

Expected results:
Successful build


Additional info:
Was looking at the OCP3.4 branch and it looks like the code you referenced that checks for the scratch image pre-pull is missing in OCP:

https://github.com/openshift/ose/blob/enterprise-3.4/pkg/build/builder/docker.go#L97

https://github.com/openshift/origin/blob/master/pkg/build/builder/docker.go#L102-L120

Also looks like that code has changed significantly since 3.3

Comment 1 Ben Parees 2017-01-25 14:46:19 UTC
https://github.com/openshift/ose/pull/579

Comment 4 Troy Dawson 2017-02-10 23:01:00 UTC
This has been merged into ocp and is in OCP v3.4.1.7 or newer.

Comment 6 Dongbo Yan 2017-02-13 04:46:15 UTC
Verified
openshift v3.4.1.7
kubernetes v1.4.0+776c994
etcd 3.1.0-rc.0

# oc new-build -D $'FROM scratch\nENV NUM 1' --to=test

# oc logs -f bc/test
Step 1 : FROM scratch
 ---> 
Step 2 : ENV NUM 1
 ---> Running in c67ed76f2559
 ---> 328f24a22408
Removing intermediate container c67ed76f2559
Step 3 : ENV "OPENSHIFT_BUILD_NAME" "test-1" "OPENSHIFT_BUILD_NAMESPACE" "dyan1"
 ---> Running in ba4d1bf25a7a
 ---> 8bb37118587c
Removing intermediate container ba4d1bf25a7a
Successfully built 8bb37118587c

Comment 8 errata-xmlrpc 2017-02-22 18:11:23 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-2017:0289


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