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