Skip to content

Commit

Permalink
Merge pull request #1449 from kakkoyun/release-0.12
Browse files Browse the repository at this point in the history
Fix health check binary download
  • Loading branch information
kakkoyun committed Jul 29, 2022
2 parents dcc64c8 + 6a0adf8 commit bb247a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
12 changes: 4 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform="${BUILDPLATFORM:-linux/amd64}" docker.io/golang:1.18.4-alpine@sha256:46f1fa18ca1ec228f7ea4978ad717f0a8c5e51436e7b8efaf64011f7729886df AS builder
FROM --platform="${BUILDPLATFORM:-linux/amd64}" docker.io/library/busybox:1.35.0 as builder
RUN mkdir /.cache && touch -t 202101010000.00 /.cache

ARG TARGETOS=linux
Expand All @@ -7,12 +7,8 @@ ARG TARGETVARIANT=v1

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

RUN go install "github.com/grpc-ecosystem/grpc-health-probe@${GRPC_HEALTH_PROBE_VERSION}"
# Predicatable path for copying over to final image
RUN if [ "$(go env GOHOSTARCH)" != "$(go env GOARCH)" ]; then \
mv "$(go env GOPATH)/bin/$(go env GOOS)_$(go env GOARCH)/grpc-health-probe" "$(go env GOPATH)/bin/grpc-health-probe"; \
fi
RUN 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}
RUN chmod +x /bin/grpc_health_probe

WORKDIR /app
COPY dist dist
Expand All @@ -31,7 +27,7 @@ FROM --platform="${TARGETPLATFORM:-linux/amd64}" docker.io/alpine:3.16.0@sha256

USER nobody

COPY --chown=0:0 --from=builder /go/bin/grpc-health-probe /
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
4 changes: 2 additions & 2 deletions deploy/lib/parca/parca.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ function(params) {
livenessProbe: if prc.config.livenessProbe == true then {
initialDelaySeconds: 5,
exec: {
command: ['/grpc-health-probe', '-v', '-addr=:' + prc.config.port],
command: ['/grpc_health_probe', '-v', '-addr=:' + prc.config.port],
},
},
readinessProbe: if prc.config.readinessProbe == true then {
initialDelaySeconds: 10,
exec: {
command: ['/grpc-health-probe', '-v', '-addr=:' + prc.config.port],
command: ['/grpc_health_probe', '-v', '-addr=:' + prc.config.port],
},
},
};
Expand Down

0 comments on commit bb247a1

Please sign in to comment.