From 71ddb5bcb209ef1343c27ba28ed3dffbadb037a8 Mon Sep 17 00:00:00 2001 From: Patrick Dillon Date: Wed, 3 May 2023 11:34:58 -0400 Subject: [PATCH 1/2] images: decouple installer and installer-artifacts The installer-artifacts image depends on the installer image, which means they cannot be built in parallel. The effect of this dependency is that the installer-artifacts image contains the linux amd64 builds in addition to the mac/linux amd64/arm64 builds present in the installer-artifacts image. Breaking the dependency results in a more efficient build process because they can be built in parallel as well as no duplication of the linux amd64 binary in the release image (before this change the binary would be present in both images within the release image). The risk, though, is that clients are inconsistently grabbing the linux amd64 binary from either image, rather than only the installer image, in which case we would break any client trying to get that binary from the installer-artifacts image. --- images/installer-artifacts/Dockerfile.rhel | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/images/installer-artifacts/Dockerfile.rhel b/images/installer-artifacts/Dockerfile.rhel index 750a2095dbf..0cd31190363 100644 --- a/images/installer-artifacts/Dockerfile.rhel +++ b/images/installer-artifacts/Dockerfile.rhel @@ -25,8 +25,15 @@ WORKDIR /go/src/github.com/openshift/installer COPY . . RUN GOOS=linux GOARCH=arm64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh -FROM registry.ci.openshift.org/ocp/4.14:installer +FROM registry.ci.openshift.org/ocp/4.14:base COPY --from=macbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/mac/openshift-install COPY --from=macarmbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/mac_arm64/openshift-install COPY --from=linuxbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/linux_amd64/openshift-install COPY --from=linuxarmbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/linux_arm64/openshift-install +RUN mkdir /output && chown 1000:1000 /output +USER 1000:1000 +ENV PATH /bin +ENV HOME /output +WORKDIR /output +# We're not really an operator, we're just getting some data into the release image. +LABEL io.openshift.release.operator=true From 1df778eca5e325b577412441d97750eb6c35f67f Mon Sep 17 00:00:00 2001 From: Patrick Dillon Date: Tue, 9 May 2023 09:45:17 -0400 Subject: [PATCH 2/2] fixup! remove extra dockerfile commands --- images/installer-artifacts/Dockerfile.rhel | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/images/installer-artifacts/Dockerfile.rhel b/images/installer-artifacts/Dockerfile.rhel index 0cd31190363..7bd8d56a464 100644 --- a/images/installer-artifacts/Dockerfile.rhel +++ b/images/installer-artifacts/Dockerfile.rhel @@ -30,10 +30,6 @@ COPY --from=macbuilder /go/src/github.com/openshift/installer/bin/openshift-inst COPY --from=macarmbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/mac_arm64/openshift-install COPY --from=linuxbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/linux_amd64/openshift-install COPY --from=linuxarmbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/linux_arm64/openshift-install -RUN mkdir /output && chown 1000:1000 /output -USER 1000:1000 -ENV PATH /bin -ENV HOME /output -WORKDIR /output + # We're not really an operator, we're just getting some data into the release image. LABEL io.openshift.release.operator=true