postfix_exporter/Dockerfile
Per Abich fd473ea329 Merge remote-tracking branch 'digineo/gomod' into digineo-updates
# Conflicts:
#	Dockerfile
#	go.mod
#	go.sum
2020-02-19 18:16:20 +01:00

25 lines
492 B
Docker

FROM golang:1.13 AS builder
WORKDIR /src
# avoid downloading the dependencies on succesive builds
RUN apt-get update -qq && apt-get install -qqy \
build-essential \
libsystemd-dev
COPY go.mod go.sum ./
RUN go mod download
RUN go mod verify
COPY . .
# Force the go compiler to use modules
ENV GO111MODULE=on
RUN go test
RUN go build -o /bin/postfix_exporter
FROM debian:latest
EXPOSE 9154
WORKDIR /
COPY --from=builder /bin/postfix_exporter /bin/
ENTRYPOINT ["/bin/postfix_exporter"]