open-cluster-management.io/governance-policy-propagator@v0.13.0/build/Dockerfile (about) 1 # Stage 1: Use image builder to build the target binaries 2 # Copyright Contributors to the Open Cluster Management project 3 4 FROM registry.ci.openshift.org/stolostron/builder:go1.21-linux AS builder 5 6 ENV COMPONENT=governance-policy-propagator 7 ENV REPO_PATH=/go/src/github.com/open-cluster-management/${COMPONENT} 8 WORKDIR ${REPO_PATH} 9 COPY . . 10 RUN make build 11 12 # Stage 2: Copy the binaries from the image builder to the base image 13 FROM registry.access.redhat.com/ubi8/ubi-minimal:latest 14 15 ENV COMPONENT=governance-policy-propagator 16 ENV REPO_PATH=/go/src/github.com/open-cluster-management/${COMPONENT} 17 ENV OPERATOR=/usr/local/bin/${COMPONENT} \ 18 USER_UID=1001 \ 19 USER_NAME=${COMPONENT} 20 21 # install operator binary 22 COPY --from=builder ${REPO_PATH}/build/_output/bin/${COMPONENT} ${OPERATOR} 23 24 COPY --from=builder ${REPO_PATH}/build/bin /usr/local/bin 25 RUN /usr/local/bin/user_setup 26 27 ENTRYPOINT ["/usr/local/bin/entrypoint"] 28 29 RUN microdnf update && \ 30 microdnf clean all 31 32 USER ${USER_UID}