Skip to content

question regarding referencing intermediate stage in multi stage builds #25887

@jericbryledy

Description

@jericbryledy

How to build (using BuildConfig) with a Dockerfile with multi stage referencing to a previous stage? I tried building a multi staged Dockerfile on my local machine and it works. The same file fails on openshift, because openshift tries to download the images as an external image, even though some of the image are intermediate image from previous stage

Version
oc v3.9.43
kubernetes v1.9.1+a0ce1bc657
features: Basic-Auth
Steps To Reproduce
  1. create a valid multi staged Dockerfile with reference to previous stage, example:
FROM alpine:latest as stage0

RUN echo 'do something'

FROM alpine:latest as stage1

RUN echo 'do something else'

FROM stage0

RUN echo 'do something else again'

  1. build
Current Result
Pulling image stage0 ...
error: build error: failed to pull image: Get https://....: unauthorized: authentication required
error: the build ... status is "Failed"
Expected Result

should build successfully, like running:
docker build .

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions