-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile.operator
More file actions
34 lines (24 loc) · 1.08 KB
/
Copy pathDockerfile.operator
File metadata and controls
34 lines (24 loc) · 1.08 KB
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
33
34
# Build the termite-operator binary
FROM golang:1.26-alpine AS builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY pkg/operator/go.mod pkg/operator/go.mod
COPY pkg/operator/go.sum pkg/operator/go.sum
# Copy the go source
COPY pkg/operator/ pkg/operator/
WORKDIR /workspace/pkg/operator
# Declare build arguments for multi-arch support (automatically provided by Docker Buildx)
ARG TARGETOS
ARG TARGETARCH
# Build for the target platform
RUN GOEXPERIMENT=simd CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o /workspace/manager ./cmd/termite-operator
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
LABEL org.opencontainers.image.source=https://github.com/antflydb/antfly
LABEL org.opencontainers.image.description="Termite Operator - Kubernetes operator for Termite ML inference services"
LABEL org.opencontainers.image.licenses=Apache-2.0
WORKDIR /
COPY --from=builder /workspace/manager .
USER 65532:65532
ENTRYPOINT ["/manager"]