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"]