diff --git a/devenv/docker/blocks/prometheus_random_data/Dockerfile b/devenv/docker/blocks/prometheus_random_data/Dockerfile index 281262933e5..9f298774683 100644 --- a/devenv/docker/blocks/prometheus_random_data/Dockerfile +++ b/devenv/docker/blocks/prometheus_random_data/Dockerfile @@ -3,16 +3,11 @@ # Builder image, where we build the example. FROM golang:1.17 AS builder # Download prometheus/client_golang/examples/random first -RUN go get github.com/prometheus/client_golang/examples/random -WORKDIR /go/src/github.com/prometheus/client_golang -WORKDIR /go/src/github.com/prometheus/client_golang/prometheus -RUN go get -d -WORKDIR /go/src/github.com/prometheus/client_golang/examples/random -RUN CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w' +RUN CGO_ENABLED=0 GOOS=linux go install -tags netgo -ldflags '-w' github.com/prometheus/client_golang/examples/random@latest # Final image. FROM scratch LABEL maintainer "The Prometheus Authors " -COPY --from=builder /go/src/github.com/prometheus/client_golang/examples/random . +COPY --from=builder /go/bin/random . EXPOSE 8080 ENTRYPOINT ["/random"]