Skip to content

Instantly share code, notes, and snippets.

@ondrejmo
Created December 26, 2021 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ondrejmo/4b374f865058779f8a312e842ab8695c to your computer and use it in GitHub Desktop.
Save ondrejmo/4b374f865058779f8a312e842ab8695c to your computer and use it in GitHub Desktop.
Custom Dockerfile for nshttpd/mikrotik-exporter
FROM docker.io/library/golang:1.17-bullseye as builder
ARG MIKROTIK_VERSION=4bfa7adfef500ff621a677adfab1f7010af920d1
RUN git clone https://github.com/nshttpd/mikrotik-exporter /src && \
cd /src && \
git checkout $MIKROTIK_VERSION && \
git reset --hard && \
make build
FROM docker.io/library/debian:bullseye-slim
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /src/mikrotik-exporter /mikrotik-exporter
COPY config.yml /config.yml
EXPOSE 9436/tcp
ENTRYPOINT [ "/mikrotik-exporter" ]
CMD [ "-log-level=fatal", "-config-file=/config.yml" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment