[DOCKER][EDIT] Updated Dockerfile

This commit is contained in:
Alexandre CHAZAL
2021-04-04 19:50:13 +02:00
parent cb83d98dd9
commit d01f8885e0

View File

@@ -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"]
ENTRYPOINT ["/app/start.sh"]