One of our tests is a multistage build FROM scratch as test USER 1001 FROM %[1]s COPY --from=test /usr/bin/curl /test/ COPY --from=%[1]s /bin/echo /test/ COPY --from=%[1]s /bin/ping /test/ where %[1]s is "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" This fails with STEP 5: COPY --from=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest /bin/echo /test/ error: build error: error building at STEP "COPY --from=image-registry.openshift-image-registry.svc:5000/openshift/tools:latest /bin/echo /test/": the stage "image-registry.openshift-image-registry.svc:5000/openshift/tools:latest" has not been built which is not correct. --from implies image OR stage by name. I tried to run FROM scratch as test USER 1001 FROM %[1]s as other COPY --from=test /usr/bin/curl /test/ COPY --from=%[1]s /bin/echo /test/ COPY --from=%[1]s /bin/ping /test/ and it still failed. There was an attempted fix in https://github.com/containers/buildah/pull/2321, but it either didn't make it into 4.5/master or may not cover the whole problem. Marked as 4.5, this needs to be fixed and backported potentially to 4.4.
This did not make it to 4.5/master - this merged in buildah master, but is not available in a v1.14.z stream. Openshift/builder currently uses buildah v1.14.2 [1]. Moving this to the Containers team so that we get this backported to buildah v1.14.z, and cloning to ensure this gets into builds. [1] https://github.com/openshift/builder/blob/release-4.5/go.mod
Upstream PR at: https://github.com/containers/buildah/pull/2401. Vendoring underway with this PR: https://github.com/openshift/builder/pull/160