Dockerfile 752 B

123456789101112131415161718
  1. # This Dockerfile builds an image for a client_golang example.
  2. # Builder image, where we build the example.
  3. FROM golang:1.9.0 AS builder
  4. # Download prometheus/client_golang/examples/random first
  5. RUN go get github.com/prometheus/client_golang/examples/random
  6. WORKDIR /go/src/github.com/prometheus/client_golang
  7. WORKDIR /go/src/github.com/prometheus/client_golang/prometheus
  8. RUN go get -d
  9. WORKDIR /go/src/github.com/prometheus/client_golang/examples/random
  10. RUN CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w'
  11. # Final image.
  12. FROM scratch
  13. LABEL maintainer "The Prometheus Authors <prometheus-developers@googlegroups.com>"
  14. COPY --from=builder /go/src/github.com/prometheus/client_golang/examples/random .
  15. EXPOSE 8080
  16. ENTRYPOINT ["/random"]