You've already forked ssl_exporter
mirror of
https://github.com/ribbybibby/ssl_exporter.git
synced 2025-07-06 23:37:23 +02:00
It looks like there's a standard approach most Prometheus exporters use when building Dockerfiles, so I'm going to adhere to that. Rather than building the binary inside the container, it's built outside and then copied into the bin dir.
This commit is contained in:
21
Dockerfile
21
Dockerfile
@ -1,20 +1,5 @@
|
|||||||
FROM golang:1.8.3-alpine3.6 as builder
|
FROM quay.io/prometheus/busybox:latest
|
||||||
|
|
||||||
ENV GOOS=linux GOARCH=amd64 GOPATH=/go
|
COPY ssl_exporter /bin/ssl_exporter
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/ribbybibby/ssl_exporter
|
ENTRYPOINT ["/bin/ssl_exporter"]
|
||||||
|
|
||||||
RUN apk --no-cache --quiet add git
|
|
||||||
RUN go get "github.com/prometheus/client_golang/prometheus" "gopkg.in/alecthomas/kingpin.v2" "github.com/sirupsen/logrus"
|
|
||||||
|
|
||||||
COPY . /go/src/github.com/ribbybibby/ssl_exporter
|
|
||||||
|
|
||||||
RUN go build
|
|
||||||
|
|
||||||
FROM alpine:3.6
|
|
||||||
|
|
||||||
RUN apk add --quiet --no-cache ca-certificates tzdata && rm -rf /var/cache/apk/*
|
|
||||||
|
|
||||||
COPY --from=builder /go/src/github.com/ribbybibby/ssl_exporter/ssl_exporter /ssl_exporter
|
|
||||||
|
|
||||||
ENTRYPOINT ["/ssl_exporter"]
|
|
||||||
|
@ -9,6 +9,11 @@ Whatever it is, the SSL exporter gives you visibility over those dimensions at t
|
|||||||
## Building
|
## Building
|
||||||
make
|
make
|
||||||
./ssl_exporter <flags>
|
./ssl_exporter <flags>
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
make all docker
|
||||||
|
docker run -p 9219:9219 ssl-exporter:master <flags>
|
||||||
|
|
||||||
Similarly to the blackbox_exporter, visiting [http://localhost:9219/probe?target=https://example.com](http://localhost:9219/probe?target=https://example.com) will return certificate metrics for example.com. The ```ssl_https_connect_success``` metric indicates if the probe has been successful.
|
Similarly to the blackbox_exporter, visiting [http://localhost:9219/probe?target=https://example.com](http://localhost:9219/probe?target=https://example.com) will return certificate metrics for example.com. The ```ssl_https_connect_success``` metric indicates if the probe has been successful.
|
||||||
|
|
||||||
## Flags
|
## Flags
|
||||||
|
Reference in New Issue
Block a user