Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
ARG TARGETPLATFORM

# https://github.com/hadolint/hadolint/issues/861
# hadolint ignore=DL3029
FROM --platform="${BUILDPLATFORM:-linux/amd64}" docker.io/busybox:1.37.0@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec as builder
RUN mkdir /.cache && touch -t 202101010000.00 /.cache
RUN mkdir /.cache /data && 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

Expand All @@ -33,19 +24,18 @@ 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
FROM --platform="${TARGETPLATFORM}" 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
COPY --chown=65534:0 --from=builder /data /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

Expand Down
6 changes: 0 additions & 6 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,11 @@ FROM docker.io/golang:1.25.6-alpine@sha256:98e6cffc31ccc44c7c15d83df1d69891efee8
# renovate: datasource=go depName=github.com/go-delve/delve
ARG DLV_VERSION=v1.26.1

# renovate: datasource=go depName=github.com/grpc-ecosystem/grpc-health-probe
ARG GRPC_HEALTH_PROBE_VERSION=v0.4.47

WORKDIR /app

# hadolint ignore=DL3018
RUN apk update && apk add --no-cache build-base
RUN go install "github.com/go-delve/delve/cmd/dlv@${DLV_VERSION}"
# hadolint ignore=DL3059
RUN go install "github.com/grpc-ecosystem/grpc-health-probe@${GRPC_HEALTH_PROBE_VERSION}"

COPY go.mod go.sum /app/
RUN go mod download -modcacherw
Expand All @@ -48,7 +43,6 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -gcflags="all=-N -l
FROM docker.io/golang:1.25.6-alpine@sha256:98e6cffc31ccc44c7c15d83df1d69891efee8115a5bb7ede2bf30a38af3e3c92

COPY --from=builder /go/bin/dlv /
COPY --from=builder /go/bin/grpc-health-probe /
COPY --from=builder /app/parca /parca
COPY parca.yaml /parca.yaml

Expand Down
6 changes: 0 additions & 6 deletions Dockerfile.go.dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ FROM docker.io/golang:1.25.6-alpine@sha256:98e6cffc31ccc44c7c15d83df1d69891efee8
# renovate: datasource=go depName=github.com/go-delve/delve
ARG DLV_VERSION=v1.26.1

# renovate: datasource=go depName=github.com/grpc-ecosystem/grpc-health-probe
ARG GRPC_HEALTH_PROBE_VERSION=v0.4.47

WORKDIR /app

# hadolint ignore=DL3018
RUN apk update && apk add --no-cache build-base
RUN go install "github.com/go-delve/delve/cmd/dlv@${DLV_VERSION}"
# hadolint ignore=DL3059
RUN go install "github.com/grpc-ecosystem/grpc-health-probe@${GRPC_HEALTH_PROBE_VERSION}"

COPY go.mod go.sum /app/
RUN go mod download -modcacherw
Expand All @@ -39,7 +34,6 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags="all=-N -l" -o parca
FROM docker.io/golang:1.25.6-alpine@sha256:98e6cffc31ccc44c7c15d83df1d69891efee8115a5bb7ede2bf30a38af3e3c92

COPY --from=builder /go/bin/dlv /
COPY --from=builder /go/bin/grpc-health-probe /
COPY --from=builder /app/parca /parca
COPY parca.yaml /parca.yaml

Expand Down
8 changes: 4 additions & 4 deletions deploy/lib/parca/parca.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ function(params) {
terminationMessagePolicy: 'FallbackToLogsOnError',
livenessProbe: if prc.config.livenessProbe == true then {
initialDelaySeconds: 5,
exec: {
command: ['/grpc_health_probe', '-v', '-addr=:' + prc.config.port],
grpc: {
port: prc.config.port,
},
},
readinessProbe: if prc.config.readinessProbe == true then {
initialDelaySeconds: 10,
exec: {
command: ['/grpc_health_probe', '-v', '-addr=:' + prc.config.port],
grpc: {
port: prc.config.port,
},
},
};
Expand Down
7 changes: 0 additions & 7 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@
"matchSourceUrls": ["https://github.com/grpc-ecosystem/grpc-gateway"],
"groupName": "grpc-gateway"
},
{
"description": "Group grpc-health-probe packages",
"matchSourceUrls": [
"https://github.com/grpc-ecosystem/grpc-health-probe"
],
"groupName": "grpc-health-probe"
},
{
"description": "Group protobuf-ts packages",
"matchSourceUrls": ["https://github.com/timostamm/protobuf-ts"],
Expand Down
Loading