github.com/m-lab/locate@v0.17.6/cmd/heartbeat/Dockerfile.heartbeat (about) 1 # Built the command using a golang base image. 2 FROM golang:1.20-alpine3.18 AS build 3 RUN apk add git 4 ADD . /go/src/github.com/m-lab/locate 5 WORKDIR /go/src/github.com/m-lab/locate 6 RUN CGO_ENABLED=0 go install -v \ 7 -ldflags "-X github.com/m-lab/go/prometheusx.GitShortCommit=$(git log -1 --format=%h)" \ 8 ./cmd/heartbeat 9 10 # Now copy the resulting command into the minimal base image. 11 FROM alpine:3.18 12 COPY --from=build /go/bin/heartbeat / 13 WORKDIR / 14 ENTRYPOINT ["/heartbeat"]