-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (31 loc) · 2.08 KB
/
Dockerfile
File metadata and controls
40 lines (31 loc) · 2.08 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
# This Dockerfile builds an image containing the Mac and Windows version of kube-compare
# layered on top of the Linux cli image.
ARG SRC_DIR=/go/src/github.com/openshift/kube-compare
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.25-openshift-4.22 AS builder-rhel-8
ARG SRC_DIR
WORKDIR ${SRC_DIR}
COPY . .
RUN make cross-build --warn-undefined-variables
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder-rhel-9
ARG SRC_DIR
WORKDIR ${SRC_DIR}
COPY . .
RUN make cross-build --warn-undefined-variables
FROM registry.ci.openshift.org/ocp/4.22:cli AS final-builder
ARG SRC_DIR
COPY --from=builder-rhel-9 ${SRC_DIR}/_output/bin/ /usr/share/openshift/
RUN cd /usr/share/openshift && \
ln -sf /usr/share/openshift/linux_amd64/kube-compare /usr/bin/kube-compare && \
mv windows_amd64 windows && \
mv darwin_amd64 mac && \
mv darwin_arm64 mac_arm64
COPY --from=builder-rhel-8 ${SRC_DIR}/_output/bin/linux_amd64/kubectl-cluster_compare /usr/share/openshift/linux_amd64/kube-compare.rhel8
COPY --from=builder-rhel-8 ${SRC_DIR}/_output/bin/linux_arm64/kubectl-cluster_compare /usr/share/openshift/linux_arm64/kube-compare.rhel8
COPY --from=builder-rhel-8 ${SRC_DIR}/_output/bin/linux_ppc64le/kubectl-cluster_compare /usr/share/openshift/linux_ppc64le/kube-compare.rhel8
COPY --from=builder-rhel-8 ${SRC_DIR}/_output/bin/linux_s390x/kubectl-cluster_compare /usr/share/openshift/linux_s390x/kube-compare.rhel8
COPY --from=builder-rhel-9 ${SRC_DIR}/_output/bin/linux_amd64/kubectl-cluster_compare /usr/share/openshift/linux_amd64/kube-compare.rhel9
COPY --from=builder-rhel-9 ${SRC_DIR}/_output/bin/linux_arm64/kubectl-cluster_compare /usr/share/openshift/linux_arm64/kube-compare.rhel9
COPY --from=builder-rhel-9 ${SRC_DIR}/_output/bin/linux_ppc64le/kubectl-cluster_compare /usr/share/openshift/linux_ppc64le/kube-compare.rhel9
COPY --from=builder-rhel-9 ${SRC_DIR}/_output/bin/linux_s390x/kubectl-cluster_compare /usr/share/openshift/linux_s390x/kube-compare.rhel9
COPY --from=builder-rhel-8 ${SRC_DIR}/LICENSE /usr/share/openshift/LICENSE
WORKDIR /usr/share/openshift/