You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Dockerfile
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,16 @@ COPY controllers/ controllers/
22
22
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
23
23
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
24
24
USER root
25
-
RUN CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} GO111MODULE=on GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime -a -o manager main.go
25
+
26
+
# Accept an optional prebuilt Go binary
27
+
ARG PREBUILT_BINARY=unset
28
+
29
+
# If PREBUILT_BINARY is set, use it; otherwise, build from source
30
+
RUN if [ "$PREBUILT_BINARY" = "unset" ]; then \
31
+
CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} GO111MODULE=on GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime -a -o manager main.go; \
32
+
else \
33
+
cp ${PREBUILT_BINARY} /workspace/manager; \
34
+
fi
26
35
27
36
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
0 commit comments