forked from carvel-dev/secretgen-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
17 lines (12 loc) · 670 Bytes
/
Dockerfile
File metadata and controls
17 lines (12 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
FROM --platform=$BUILDPLATFORM golang:1.24.10 AS deps
ARG TARGETOS TARGETARCH SGCTRL_VER=development
WORKDIR /workspace
COPY . .
# helpful ldflags reference: https://www.digitalocean.com/community/tutorials/using-ldflags-to-set-version-information-for-go-applications
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -mod=vendor -ldflags="-X 'main.Version=$SGCTRL_VER' -buildid=" -trimpath -o controller ./cmd/controller/...
# --- run ---
FROM scratch
COPY --from=deps /workspace/controller secretgen-controller
# Run as secretgen-controller by default, will be overridden to a random uid on OpenShift
USER 1000
ENTRYPOINT ["/secretgen-controller"]