forked from openshift/assisted-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.bundle
36 lines (31 loc) · 1.87 KB
/
Dockerfile.bundle
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
FROM registry.ci.openshift.org/openshift/release:golang-1.16 as build
ENV GO111MODULE=on
ENV GOFLAGS=""
RUN yum install -y python3-pip && \
yum clean all
RUN curl --retry 5 -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | \
bash -s -- 3.8.8 && mv kustomize /usr/bin/
RUN pip3 install waiting==1.4.1 mkdocs==1.1.2
COPY --from=quay.io/openshift/origin-cli:latest /usr/bin/oc /usr/bin
RUN go get sigs.k8s.io/controller-tools/cmd/[email protected]
RUN export ARCH=$(case $(arch) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(arch) ;; esac) \
&& export OS=$(uname | awk '{print tolower($0)}') && export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.7.2 \
&& curl --retry 5 -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} \
&& chmod +x operator-sdk_${OS}_${ARCH} \
&& install operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk
COPY . .
RUN export BUNDLE_OUTPUT_DIR=/bundle; make operator-bundle
FROM scratch
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=assisted-service-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.4.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
COPY --from=build /bundle/manifests /manifests/
COPY --from=build /bundle/metadata /metadata/
COPY --from=build /bundle/tests/scorecard /tests/scorecard/