-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 775 Bytes
/
Dockerfile
File metadata and controls
32 lines (24 loc) · 775 Bytes
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
# Build the manager binary
FROM --platform=$BUILDPLATFORM golang:1.26.2-alpine3.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 internal/ internal/
COPY client/ client/
ARG TARGETOS TARGETARCH
ARG GOFIPS140
# Build
RUN CGO_ENABLED=0 GOFIPS140=v1.0.0 GOOS=$TARGETOS GOARCH=$TARGETARCH GO111MODULE=on go build -a -o manager main.go
FROM alpine:3.23
WORKDIR /
COPY --from=builder /workspace/manager .
USER 65534:65534
ENTRYPOINT ["/manager"]