|
| 1 | +# This Dockerfile builds an image containing Mac and Linux ARM64/AMD64 versions of the etcd. |
| 2 | +# The resulting image is used to build the statically-linked openshift-installer binary. |
| 3 | + |
| 4 | +FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.20-openshift-4.16 AS macbuilder |
| 5 | + |
| 6 | +ENV GO_COMPLIANCE_EXCLUDE=".*" |
| 7 | + |
| 8 | +WORKDIR /go/src/go.etcd.io/etcd |
| 9 | +COPY . . |
| 10 | + |
| 11 | +RUN export GOFLAGS='-mod=readonly' && export GO_BUILD_FLAGS='-v' \ |
| 12 | + && CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 ./build.sh |
| 13 | + |
| 14 | +FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.20-openshift-4.16 AS macarmbuilder |
| 15 | + |
| 16 | +ENV GO_COMPLIANCE_EXCLUDE=".*" |
| 17 | + |
| 18 | +WORKDIR /go/src/go.etcd.io/etcd |
| 19 | +COPY . . |
| 20 | + |
| 21 | +RUN export GOFLAGS='-mod=readonly' && export GO_BUILD_FLAGS='-v' \ |
| 22 | + && CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 ./build.sh |
| 23 | + |
| 24 | +FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.20-openshift-4.16 AS linuxbuilder |
| 25 | + |
| 26 | +ENV GO_COMPLIANCE_EXCLUDE=".*" |
| 27 | + |
| 28 | +WORKDIR /go/src/go.etcd.io/etcd |
| 29 | +COPY . . |
| 30 | +RUN export GOFLAGS='-mod=readonly' && export GO_BUILD_FLAGS='-v' \ |
| 31 | + && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 ./build.sh |
| 32 | + |
| 33 | +FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.20-openshift-4.16 AS linuxarmbuilder |
| 34 | + |
| 35 | +ENV GO_COMPLIANCE_EXCLUDE=".*" |
| 36 | + |
| 37 | +WORKDIR /go/src/go.etcd.io/etcd |
| 38 | +COPY . . |
| 39 | +RUN export GOFLAGS='-mod=readonly' && export GO_BUILD_FLAGS='-v' \ |
| 40 | + && CGO_ENABLED=0 GOOS=linux GOARCH=arm64 ./build.sh |
| 41 | + |
| 42 | +FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.20-openshift-4.16 AS builder |
| 43 | +ENV GO_COMPLIANCE_EXCLUDE=".*" |
| 44 | + |
| 45 | +WORKDIR /go/src/go.etcd.io/etcd |
| 46 | +COPY . . |
| 47 | +RUN export GOFLAGS='-mod=readonly' && export GO_BUILD_FLAGS='-v' \ |
| 48 | + && CGO_ENABLED=0 ./build.sh |
| 49 | +RUN mkdir -p /usr/share/openshift/$(go env GOOS)/$(go env GOHOSTARCH) && \ |
| 50 | + mv bin/etcd /usr/share/openshift/$(go env GOOS)/$(go env GOHOSTARCH)/ |
| 51 | + |
| 52 | +# stage 2 |
| 53 | +FROM registry.ci.openshift.org/ocp/4.16:base-rhel9 |
| 54 | + |
| 55 | +RUN yum install --setopt=tsflags=nodocs -y jq && yum clean all && rm -rf /var/cache/yum/* |
| 56 | + |
| 57 | +COPY --from=macbuilder /go/src/go.etcd.io/etcd/bin/etcd /usr/share/openshift/darwin/amd64/etcd |
| 58 | +COPY --from=macarmbuilder /go/src/go.etcd.io/etcd/bin/etcd /usr/share/openshift/darwin/arm64/etcd |
| 59 | +COPY --from=linuxbuilder /go/src/go.etcd.io/etcd/bin/etcd /usr/share/openshift/linux/amd64/etcd |
| 60 | +COPY --from=linuxarmbuilder /go/src/go.etcd.io/etcd/bin/etcd /usr/share/openshift/linux/arm64/etcd |
| 61 | +COPY --from=builder /usr/share/openshift/ /usr/share/openshift/ |
| 62 | + |
| 63 | +# This image is not an operator, it is only used as part of the build pipeline |
| 64 | +LABEL io.openshift.release.operator=false |
0 commit comments