File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11FROM --platform=$BUILDPLATFORM golang:1.25@sha256:36b4f45d2874905b9e8573b783292629bcb346d0a70d8d7150b6df545234818f AS builder
2+ ARG TARGETARCH
23
34WORKDIR /workspace
45
56COPY go.mod go.sum ./
6- RUN --mount=type=cache,target=/go/pkg/mod \
7- go mod download && go mod verify
7+ RUN go mod download
88
99COPY . .
10- RUN --mount=type=cache,target=/go/pkg/mod/ \
11- --mount=type=cache,target=/root/.cache/go-build \
12- CGO_ENABLED=0 \
13- GOCACHE=/root/.cache/go-build \
14- GOOS=$TARGETOS \
15- GOARCH=$TARGETARCH \
16- make build
10+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
1711
1812# Use distroless base-debian11 image to include shell access while keeping minimal footprint
1913# Refer to https://github.com/GoogleContainerTools/distroless for more details
2014FROM gcr.io/distroless/base-debian11:debug@sha256:68e5ea65df0f5d135083d4cc1df5fc16855d61ed628254df8e1affa8ce2d3244
2115WORKDIR /
22- COPY --from=builder /workspace/bin/ manager .
16+ COPY --from=builder /workspace/manager .
2317USER 65532:65532
2418
2519ENTRYPOINT ["/manager" ]
You can’t perform that action at this time.
0 commit comments