From 3e8a3a4917c1f5b0b17c32c0838cb3077b347dd6 Mon Sep 17 00:00:00 2001 From: Per Abich Date: Tue, 18 Feb 2020 13:33:30 +0100 Subject: [PATCH] Cleaning up the Dockerfile --- .dockerignore | 4 ++++ Dockerfile | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b528b7d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +# Created by .ignore support plugin (hsz.mobi) +.idea/ +*.iml +.git/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0b222c1..ab916aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"]