postfix_exporter/Dockerfile

24 lines
480 B
Docker
Raw Normal View History

FROM golang:1.11 AS builder
WORKDIR /src
# avoid downloading the dependencies on succesive builds
2018-11-04 01:57:56 +00:00
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 build -o /bin/postfix_exporter
2018-11-04 01:57:56 +00:00
FROM debian:latest
EXPOSE 9154
WORKDIR /
COPY --from=builder /bin/postfix_exporter /bin/
ENTRYPOINT ["/bin/postfix_exporter"]