FROM registry.altlinux.org/alt/alt:sisyphus AS builder ARG ZOT_VER=v2.0.4 ARG ZUI_VER=commit-09ab447 ARG ZOT_ALT_BRANCH=zot-alt ARG ZUI_ALT_BRANCH=zui-alt ARG ZOT_ALT_REPO=https://gitea.basealt.ru/alt/zot-wo-auth.git WORKDIR /workdir RUN apt-get update && apt-get install -y podman git \ golang npm rpm-build-golang rpm-build-nodejs rpm-macros-golang && \ rm -f /var/cache/apt/archives/*.rpm \ /var/cache/apt/*.bin \ /var/lib/apt/lists/*.* RUN git clone -q --branch $ZOT_ALT_BRANCH $ZOT_ALT_REPO zot WORKDIR zot RUN git clone -q --branch $ZUI_ALT_BRANCH $ZOT_ALT_REPO zui WORKDIR zui RUN npm install && npm run build WORKDIR /workdir/zot RUN make COMMIT=$ZOT_VER ZUI_BUILD_PATH="/workdir/zot/zui/build" binary cli bench RUN export ARCH=$(go env GOARCH); bin/zli-linux-$ARCH completion bash > zli.bash RUN export ARCH=$(go env GOARCH); bin/zot-linux-$ARCH completion bash > zot.bash FROM registry.altlinux.org/alt/alt:sisyphus MAINTAINER alt-cloud LABEL org.opencontainers.image.title="zot" LABEL org.opencontainers.image.description="A production-ready vendor-neutral OCI-native container image registry (purely based on OCI Distribution Specification)" LABEL org.opencontainers.image.source="https://github.com/project-zot/zot" LABEL org.opencontainers.image.licenses="Apache-2.0" LABEL org.opencontainers.image.vendor="ALT Linux Team" COPY --from=builder /workdir/zot/bin/zot-linux-* /usr/bin/zot COPY --from=builder /workdir/zot/bin/zli-linux-* /usr/bin/zli COPY --from=builder /workdir/zot/bin/zb-linux-* /usr/bin/zb COPY ./config.json /etc/zot/config.json COPY --from=builder /workdir/zot/zot.bash /usr/share/bash-completion/completions/zot COPY --from=builder /workdir/zot/zli.bash /usr/share/bash-completion/completions/zli RUN apt-get update && apt-get install -y ca-certificates && \ rm -f /var/cache/apt/archives/*.rpm \ /var/cache/apt/*.bin \ /var/lib/apt/lists/*.* RUN groupadd -r -f -g 10001 _zot RUN useradd -r -g _zot -M -d /var/lib/zot -s /dev/null -c "Zot registry user" -u 10001 _zot USER _zot:_zot VOLUME ["/var/lib/zot"] EXPOSE 5000 ENTRYPOINT ["/usr/bin/zot"] CMD ["serve", "/etc/zot/config.json"]