Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1416456 - BuildConfig with Docker strategy using Dockerfile with 'FROM scratch' results in a failed build
BuildConfig with Docker strategy using Dockerfile with 'FROM scratch' results...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build (Show other bugs)
3.4.0
Unspecified Unspecified
unspecified Severity high
: ---
: 3.4.z
Assigned To: Ben Parees
Wang Haoran
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-01-25 09:42 EST by Bill DeCoste
Modified: 2017-02-22 13:11 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
If this bug requires documentation, please select an appropriate Doc Type value.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-02-22 13:11:23 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0289 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 18:10:04 EST

  None (edit)
Description Bill DeCoste 2017-01-25 09:42:54 EST
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 09:46:19 EST
https://github.com/openshift/ose/pull/579
Comment 4 Troy Dawson 2017-02-10 18:01:00 EST
This has been merged into ocp and is in OCP v3.4.1.7 or newer.
Comment 6 Dongbo Yan 2017-02-12 23:46:15 EST
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 13:11:23 EST
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.