1
0
mirror of https://github.com/coreos/prometheus-operator.git synced 2026-02-05 06:45:27 +01:00
Files
prometheus-operator/Dockerfile
dongjiang 83ed01170f Merge pull request #8062 from kubeservice-stack/update-thanos-v0.40.1
chore: Update thanos version to v0.40.1 and golang version to 1.25
2025-11-24 21:35:15 +01:00

31 lines
989 B
Docker

ARG ARCH=amd64
ARG OS=linux
ARG GOLANG_BUILDER=1.25
FROM quay.io/prometheus/golang-builder:${GOLANG_BUILDER}-base AS builder
WORKDIR /workspace
COPY . .
# Download Go dependencies to reuse the Go cache in subsequent builds.
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build go mod download -x && go mod verify
# Build
ARG GOARCH
ENV GOARCH=${GOARCH}
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build make operator
FROM quay.io/prometheus/busybox-${OS}-${ARCH}:latest
COPY --from=builder workspace/operator /bin/operator
# On busybox 'nobody' has uid `65534'
USER 65534
LABEL org.opencontainers.image.source="https://github.com/prometheus-operator/prometheus-operator" \
org.opencontainers.image.url="https://prometheus-operator.dev/" \
org.opencontainers.image.documentation="https://prometheus-operator.dev/" \
org.opencontainers.image.licenses="Apache-2.0"
ENTRYPOINT ["/bin/operator"]