# https://github.com/hadolint/hadolint/issues/861 # hadolint ignore=DL3029 FROM --platform="${BUILDPLATFORM:-linux/amd64}" docker.io/busybox:1.37.0@sha256:1487d0af5f52b4ba31c7e465126ee2123fe3f2305d638e7827681e7cf6c83d5e as builder RUN mkdir /.cache && touch -t 202101010000.00 /.cache ARG TARGETOS=linux ARG TARGETARCH=amd64 ARG TARGETVARIANT=v1 # renovate: datasource=github-releases depName=grpc-ecosystem/grpc-health-probe ARG GRPC_HEALTH_PROBE_VERSION=v0.4.57 # Downloading grpc_health_probe from github releases with retry as we have seen it fail a lot on ci. RUN for i in $(seq 1 50); do \ wget -qO/bin/grpc_health_probe "https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-${TARGETOS}-${TARGETARCH}" && \ chmod +x /bin/grpc_health_probe && \ break; \ echo "Failed to download grpc_health_probe on $i th attempt, retrying in 5s..." \ sleep 5; \ done WORKDIR /app COPY dist dist # NOTICE: See goreleaser.yml for the build paths. RUN if [ "${TARGETARCH}" = 'amd64' ]; then \ cp "dist/parca_${TARGETOS}_${TARGETARCH}_${TARGETVARIANT:-v1}/parca" . ; \ elif [ "${TARGETARCH}" = 'arm' ]; then \ cp "dist/parca_${TARGETOS}_${TARGETARCH}_${TARGETVARIANT##v}/parca" . ; \ else \ cp "dist/parca_${TARGETOS}_${TARGETARCH}/parca" . ; \ fi RUN chmod +x parca # https://github.com/hadolint/hadolint/issues/861 # hadolint ignore=DL3029 FROM --platform="${TARGETPLATFORM:-linux/amd64}" docker.io/alpine:3.24.2@sha256:294b683cb724975bec92580e1e685676bd4b50bda910ddb8c51d4cabeaec77e6 AS runner LABEL \ org.opencontainers.image.source="https://github.com/parca-dev/parca" \ org.opencontainers.image.url="https://github.com/parca-dev/parca" \ org.opencontainers.image.description="Continuous profiling for analysis of CPU and memory usage, down to the line number and throughout time. Saving infrastructure cost, improving performance, and increasing reliability." \ org.opencontainers.image.licenses="Apache-2.0" RUN mkdir /data && chown nobody /data # hadolint ignore=DL3066 USER nobody COPY --chown=0:0 --from=builder /bin/grpc_health_probe / COPY --chown=0:0 --from=builder /app/parca /parca COPY --chown=0:0 parca.yaml /parca.yaml CMD ["/parca"]