2020-11-17 13:13:26 +01:00
|
|
|
ARG build_image
|
2021-03-24 10:10:53 +01:00
|
|
|
ARG harbor_base_image_version
|
|
|
|
ARG harbor_base_namespace
|
|
|
|
|
2020-11-17 13:13:26 +01:00
|
|
|
FROM ${build_image} AS build
|
|
|
|
|
|
|
|
ENV CGO_ENABLED=0
|
|
|
|
ENV GOOS=linux
|
|
|
|
ENV GOARCH=amd64
|
|
|
|
|
|
|
|
COPY src /harbor/src
|
|
|
|
WORKDIR /harbor/src/cmd/exporter
|
|
|
|
RUN go build -o /out/harbor_exporter
|
|
|
|
|
2021-03-24 10:10:53 +01:00
|
|
|
FROM ${harbor_base_namespace}/harbor-exporter-base:${harbor_base_image_version}
|
2020-11-17 13:13:26 +01:00
|
|
|
|
|
|
|
COPY --from=build /out/harbor_exporter /harbor/harbor_exporter
|
2021-01-20 03:52:34 +01:00
|
|
|
COPY ./make/photon/exporter/entrypoint.sh ./make/photon/common/install_cert.sh /harbor/
|
|
|
|
|
|
|
|
RUN chown -R harbor:harbor /etc/pki/tls/certs \
|
|
|
|
&& chown -R harbor:harbor /harbor/ \
|
|
|
|
&& chmod u+x /harbor/entrypoint.sh \
|
|
|
|
&& chmod u+x /harbor/install_cert.sh \
|
|
|
|
&& chmod u+x /harbor/harbor_exporter
|
2020-11-17 13:13:26 +01:00
|
|
|
|
|
|
|
WORKDIR /harbor
|
|
|
|
USER harbor
|
|
|
|
|
2021-01-20 03:52:34 +01:00
|
|
|
ENTRYPOINT ["/harbor/entrypoint.sh"]
|