Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit 0f21870

Browse files
committed
feat: add docker multi stage
1 parent a815556 commit 0f21870

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: Dockerfile

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
FROM golang:alpine as build
2+
RUN apk --no-cache add ca-certificates make
3+
WORKDIR /go/src/app
4+
COPY . .
5+
RUN make build
6+
17
FROM scratch
28
EXPOSE 9111
39
WORKDIR /
4-
COPY postgresql_exporter .
10+
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
11+
COPY --from=build /go/src/app/postgresql_exporter /
512
ENTRYPOINT ["./postgresql_exporter"]

0 commit comments

Comments
 (0)