-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathDockerfile.rhtap
35 lines (26 loc) · 1.08 KB
/
Dockerfile.rhtap
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
# Copyright Contributors to the Open Cluster Management project
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.22 AS builder
COPY . .
RUN chmod g+w . && \
git config --global --add safe.directory "$PWD" && \
GOFLAGS="" go build ./cmd/manager && \
GOFLAGS="" go test \
-covermode=atomic \
-coverpkg=github.com/stolostron/klusterlet-addon-controller/pkg/... \
-c -tags testrunmain ./cmd/manager \
-o manager-coverage
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
RUN microdnf update -y && \
microdnf clean all
ENV IMAGE_MANIFEST_PATH=/
ENV OPERATOR=/usr/local/bin/klusterlet-addon-controller \
USER_UID=10001 \
USER_NAME=klusterlet-addon-controller
COPY --from=builder ./deploy/crds deploy/crds
COPY --from=builder ./manager ${OPERATOR}
COPY --from=builder ./manager-coverage ${OPERATOR}-coverage
COPY --from=builder ./build/bin /usr/local/bin
COPY --from=builder ./build/coverage-entrypoint-func.sh /usr/local/bin/coverage-entrypoint-func.sh
RUN /usr/local/bin/user_setup
USER ${USER_UID}
ENTRYPOINT ["/usr/local/bin/entrypoint"]