重新编译redis_exporter源码,构建镜像

1.github

https://github.com/oliver006/redis_exporter

 

2.dockerfile

FROM golang:1.17
ENV GO111MODULE=on \
    GOPROXY="https://goproxy.cn,direct"
COPY redis_exporter-1.43.1 /apps/redis_exporter-1.43.1
WORKDIR /apps/redis_exporter-1.43.1
RUN go build .
RUN cp /apps/redis_exporter-1.43.1/redis_exporter /bin/redis_exporter && cp -r /etc/ssl/certs /etc/ssl/certs
WORKDIR /apps/redis_exporter-1.43.1
EXPOSE      9121
ENTRYPOINT  [ "/bin/redis_exporter" ]

 

posted @ 2022-08-28 18:56  wdgde  阅读(107)  评论(0)    收藏  举报