FROM docker.io/bitnami/minideb:bullseye
ENV HOME="/" \
    OS_ARCH="amd64" \
    OS_FLAVOUR="debian-11" \
    OS_NAME="linux"

COPY prebuildfs /
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install required system packages and dependencies
RUN install_packages acl ca-certificates curl gzip libc6 procps tar
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "harbor-exporter" "2.5.3-0" --checksum 05637333f996d9295fa621cb39830942f89078eb73a2ae9bd3564d8f85b581da
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "gosu" "1.14.0-151" --checksum 089bb11a3bc6031c5a91ab5f9534e9e7e41b928d10d72a3986f16bb61d3a9900
RUN apt-get update && apt-get upgrade -y && \
    rm -r /var/lib/apt/lists /var/cache/apt/archives
RUN chmod g+rwX /opt/bitnami

COPY rootfs /
RUN /opt/bitnami/scripts/harbor-exporter/postunpack.sh
ENV APP_VERSION="2.5.3" \
    BITNAMI_APP_NAME="harbor-exporter" \
    PATH="/opt/bitnami/harbor-exporter/bin:/opt/bitnami/common/bin:$PATH"

EXPOSE 9090

WORKDIR /opt/bitnami/harbor-exporter
USER 1001
ENTRYPOINT [ "/opt/bitnami/scripts/harbor-exporter/entrypoint.sh" ]
CMD [ "/opt/bitnami/scripts/harbor-exporter/run.sh" ]
