重新编译harbor-exporter源码,构建镜像

1.github

https://github.com/c4po/harbor_exporter

 

2.dockerfile

FROM golang:1.17
ENV GO111MODULE=on \
    GOPROXY="https://goproxy.cn,direct"
COPY harbor_exporter-0.6.4 /apps/harbor_exporter-0.6.4
WORKDIR /apps/harbor_exporter-0.6.4
RUN make build

RUN apk --no-cache add ca-certificates
RUN addgroup -g 1001 appgroup && \
  adduser -H -D -s /bin/false -G appgroup -u 1001 appuser
USER 1001:1001
RUN cp /apps/harbor_exporter-0.6.4/releases/harbor_exporter /bin/harbor_exporter
ENTRYPOINT ["/bin/harbor_exporter"]

 

posted @ 2023-03-04 14:55  wdgde  阅读(111)  评论(0)    收藏  举报