-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
56 lines (42 loc) · 1.42 KB
/
Dockerfile
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
# Build the manager binary
FROM --platform=$BUILDPLATFORM golang:1.23 AS builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
COPY main.go main.go
COPY api/ api/
COPY controllers/ controllers/
COPY console/ console/
# Build
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -o manager main.go
FROM registry.access.redhat.com/ubi9-minimal:9.5-1733767867
RUN microdnf update -y && microdnf clean all
ARG VCS_REF
ARG VCS_URL
LABEL vendor="IBM" \
name="ibm-storage-odf-operator" \
org.label-schema.vendor="IBM" \
org.label-schema.name="ibm storage odf operator" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url=$VCS_URL \
org.label-schema.schema-version="1.7.0" \
summary="IBM Storage ODF Operator" \
description="operator and driver of ibm storage systems for openshift data foundation (ODF)"
WORKDIR /
COPY --from=builder /workspace/manager /manager
# COPY RULES
COPY /rules/*.yaml /prometheus-rules/
RUN mkdir /licenses
COPY /LICENSE /licenses/
ENV USER_UID=1001 \
USER_NAME=ibm-storage-odf-operator
COPY hack/user_setup /usr/local/bin/user_setup
RUN chmod 777 /usr/local/bin/user_setup
RUN /usr/local/bin/user_setup
USER ${USER_UID}
ENTRYPOINT ["/manager"]