diff --git a/Dockerfile b/Dockerfile index 4b2de78..c8c6789 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,15 @@ -FROM quay.io/prometheus/busybox:latest -MAINTAINER The Prometheus Authors +FROM golang:1.8 +MAINTAINER Yaroslav Molochko -COPY haproxy_exporter /bin/haproxy_exporter +COPY . /go/src/github.com/anchorfree/haproxy-exporter +RUN go get github.com/prometheus/log \ + && go get github.com/prometheus/client_golang/prometheus \ + && CGO_ENABLED=0 go build -a -tags netgo -o /build/haproxy_exporter github.com/anchorfree/haproxy-exporter -ENTRYPOINT ["/bin/haproxy_exporter"] +FROM alpine +MAINTAINER Yaroslav Molochko + +COPY --from=0 /build/haproxy_exporter / EXPOSE 9101 + +ENTRYPOINT ["/haproxy_exporter"] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..0c516d1 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,14 @@ +#!groovy​ + +pipeline { + agent { label 'ubuntu16' + } + + stages { + stage('Build') { + steps { + dockerBuildTagPush() + } + } + } +}