Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/operator/Dockerfile.cross

29 lines
1.0 KiB

# Build the manager binary. BUILD_IMAGE defaults to the same Go image as Dockerfile.
ARG BUILD_IMAGE=golang:1.25.9
FROM ${BUILD_IMAGE} AS builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY api/ api/
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 cmd/loki-operator/main.go cmd/loki-operator/main.go
COPY internal/ internal/
# Build (GOARCH/GOARM follow the build platform; use docker buildx --platform for cross-compiles)
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on GOARCH=$(go env GOARCH) GOARM=$(go env GOARM) go build -mod=readonly -o manager cmd/loki-operator/main.go
# 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
WORKDIR /
COPY --from=builder /workspace/manager .
USER 65532:65532
ENTRYPOINT ["/manager"]