Skip to content

Commit

Permalink
Build grpc_health_probe and re-order dockerfile layers
Browse files Browse the repository at this point in the history
  • Loading branch information
robincw-gr committed Oct 15, 2019
1 parent 1196e55 commit d101374
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
FROM golang:alpine AS build-env
ADD . /src
WORKDIR /src
ENV GOOS=linux
RUN apk add git
RUN go get github.com/grpc-ecosystem/grpc-health-probe@v0.3.0
ENV GO111MODULE=on
RUN go build -mod=vendor -ldflags '-extldflags "-static"' -o geras ./cmd/geras/main.go

# final stage
FROM alpine
WORKDIR /bin
COPY --from=build-env /src/geras /bin/
ARG GRPC_HEALTH_PROBE_REPO_URL=https://github.com/grpc-ecosystem/grpc-health-probe
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.0 && \
wget -qO/bin/grpc_health_probe ${GRPC_HEALTH_PROBE_REPO_URL}/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /bin/grpc_health_probe
COPY --from=build-env /go/bin/grpc-health-probe /bin/
USER 1000
ENTRYPOINT ["./geras"]

0 comments on commit d101374

Please sign in to comment.