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