Skip to content
This repository was archived by the owner on Sep 5, 2019. It is now read-only.

Commit 4d65ce9

Browse files
committed
improve dockerfile
1 parent 6d2cae6 commit 4d65ce9

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.dockerignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
*
2-
!bin/
1+
postgres_exporter

Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
FROM scratch
1+
FROM golang
22

3-
ARG binary
3+
WORKDIR /go/src/github.com/wrouesnel/postgres_exporter
44

5-
COPY $binary /postgres_exporter
5+
COPY . .
6+
7+
RUN go get github.com/sirupsen/logrus && go run mage.go binary
8+
9+
FROM debian:stable-slim
10+
11+
COPY --from=0 /go/src/github.com/wrouesnel/postgres_exporter/postgres_exporter /usr/bin
612

713
EXPOSE 9187
814

9-
ENTRYPOINT [ "/postgres_exporter" ]
15+
CMD [ "/usr/bin/postgres_exporter" ]

0 commit comments

Comments
 (0)