File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
components/tensorboard-controller Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 66FROM golang:1.24 as builder
77
88WORKDIR /workspace/tensorboard-controller
9- # Copy the Go Modules manifests
10- COPY tensorboard-controller /workspace/tensorboard-controller
119# cache deps before building and copying source so that we don't need to re-download as much
1210# and so that source changes don't invalidate our downloaded layer
11+ # Copy only Go module files first for better layer caching
1312COPY tensorboard-controller/go.mod tensorboard-controller/go.sum ./
13+ # Download dependencies based on mod files
1414RUN go mod download
15+ # Now copy the full source
16+ COPY tensorboard-controller/ ./
1517
1618# Build
1719RUN CGO_ENABLED=0 GOOS=linux go build -a -o /manager main.go
@@ -20,7 +22,7 @@ RUN CGO_ENABLED=0 GOOS=linux go build -a -o /manager main.go
2022# Refer to https://github.com/GoogleContainerTools/distroless for more details
2123FROM gcr.io/distroless/static:nonroot
2224WORKDIR /
23- USER 65532:65532
2425COPY --from=builder /manager /manager
26+ USER 65532:65532
2527
2628ENTRYPOINT ["/manager" ]
You can’t perform that action at this time.
0 commit comments