Cleaning up the Dockerfile

This commit is contained in:
Per Abich 2020-02-18 13:33:30 +01:00
parent 72c753ff7d
commit 3e8a3a4917
2 changed files with 7 additions and 3 deletions

4
.dockerignore Normal file
View file

@ -0,0 +1,4 @@
# Created by .ignore support plugin (hsz.mobi)
.idea/
*.iml
.git/

View file

@ -2,8 +2,8 @@
FROM golang:1.13 as builder
# Add the project in the image
ADD . /go/src/github.com/kumina/postfix_exporter
WORKDIR /go/src/github.com/kumina/postfix_exporter
ADD . /build
WORKDIR /build
# Install needed dependencies for the build
RUN apt-get update -q && apt-get install -qy \
@ -21,6 +21,6 @@ EXPOSE 9154
WORKDIR /
# Copy the binary from the build image to the real one
COPY --from=builder /go/src/github.com/kumina/postfix_exporter/postfix_exporter .
COPY --from=builder /build/postfix_exporter .
ENTRYPOINT ["/postfix_exporter"]