File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.22 as builder
2
+
3
+ # Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
4
+ ARG goproxy=https://proxy.golang.org
5
+ ENV GOPROXY=$goproxy
6
+ ENV GOFLAGS="-mod=readonly"
7
+
8
+ WORKDIR /workspace
9
+
10
+ # Copy the sources
11
+ COPY ./ ./
12
+ RUN go mod download
13
+
14
+ # Build
15
+ ARG package=.
16
+ ARG ARCH
17
+ ARG LDFLAGS
18
+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -ldflags "${LDFLAGS} -extldflags '-static'" -o manager ${package}
19
+
20
+ # Copy the controller-manager into a thin image
21
+ FROM registry.redhat.io/rhel9-4-els/rhel:9.4
22
+ WORKDIR /
23
+ COPY --from=builder /workspace/manager .
24
+ # Use uid of nonroot user (65532) because kubernetes expects numeric user when applying pod security policies
25
+ USER 65532
26
+ ENTRYPOINT ["/manager"]
You can’t perform that action at this time.
0 commit comments