1.github
https://github.com/danielqsj/kafka_exporter
2.dockerfile
FROM golang:1.17 ENV GO111MODULE=on \ GOPROXY="https://goproxy.cn,direct" COPY kafka_exporter-1.4.2 /apps/kafka_exporter-1.4.2 WORKDIR /apps/kafka_exporter-1.4.2 RUN make RUN cp /apps/kafka_exporter-1.4.2/kafka_exporter-1.4.2 /bin/kafka_exporter WORKDIR /bin EXPOSE 9308 ENTRYPOINT [ "/bin/kafka_exporter" ]