From d01f8885e081a4ed2d3fad26366064a8f2ffded2 Mon Sep 17 00:00:00 2001 From: Alexandre CHAZAL Date: Sun, 4 Apr 2021 19:50:13 +0200 Subject: [PATCH] [DOCKER][EDIT] Updated Dockerfile --- Dockerfile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3afb9de..7ed7bfa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,16 @@ -FROM debian:9.9-slim +FROM golang:latest AS builder +ENV repo=https://github.com/AlxCzl/mikrotik-exporter + +WORKDIR /go/src/mikrotik-exporter/ +RUN git clone "${repo}" . +RUN go get github.com/mitchellh/gox && go get github.com/tcnksm/ghr \ + && go build . + +FROM debian:bullseye-slim EXPOSE 9436 - +RUN apt update -y COPY scripts/start.sh /app/ -COPY dist/mikrotik-exporter_linux_amd64 /app/mikrotik-exporter - +COPY --from=builder /go/src/mikrotik-exporter/mikrotik-exporter /app/ RUN chmod 755 /app/* - -ENTRYPOINT ["/app/start.sh"] \ No newline at end of file +ENTRYPOINT ["/app/start.sh"]