Skip to content

Commit 8fa4345

Browse files
committed
Modern build + jenkinsfile
1 parent 107f51b commit 8fa4345

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

Dockerfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
FROM quay.io/prometheus/busybox:latest
2-
MAINTAINER The Prometheus Authors <prometheus-developers@googlegroups.com>
1+
FROM golang:1.8
2+
MAINTAINER Yaroslav Molochko <y.molochko@anchorfree.com>
33

4-
COPY haproxy_exporter /bin/haproxy_exporter
4+
COPY . /go/src/github.com/anchorfree/haproxy-exporter
5+
RUN go get github.com/prometheus/log \
6+
&& go get github.com/prometheus/client_golang/prometheus \
7+
&& CGO_ENABLED=0 go build -a -tags netgo -o /build/haproxy_exporter github.com/anchorfree/haproxy-exporter
58

6-
ENTRYPOINT ["/bin/haproxy_exporter"]
9+
FROM alpine
10+
MAINTAINER Yaroslav Molochko <y.molochko@anchorfree.com>
11+
12+
COPY --from=0 /build/haproxy_exporter /
713
EXPOSE 9101
14+
15+
ENTRYPOINT ["/haproxy_exporter"]

Jenkinsfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!groovy​
2+
3+
pipeline {
4+
agent { label 'ubuntu16'
5+
}
6+
7+
stages {
8+
stage('Build') {
9+
steps {
10+
dockerBuildTagPush()
11+
}
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)