zot-wo-auth/Dockerfile

58 lines
2.1 KiB
Docker
Raw Normal View History

2024-05-24 18:10:21 +03:00
FROM registry.altlinux.org/alt/alt:sisyphus AS builder
2024-04-26 13:41:11 +03:00
WORKDIR /workdir
2024-04-26 13:41:40 +03:00
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/*.*
ARG ZOT_ALT_REPO=https://gitea.basealt.ru/alt/zot-wo-auth.git \
ZOT_ALT_BRANCH=zot-alt
RUN git clone -q --branch $ZOT_ALT_BRANCH $ZOT_ALT_REPO zot
2024-04-26 13:41:11 +03:00
WORKDIR zot
ARG ZUI_ALT_BRANCH=zui-alt
RUN git clone -q --branch $ZUI_ALT_BRANCH $ZOT_ALT_REPO zui
2024-04-26 13:41:11 +03:00
WORKDIR zui
RUN npm install && npm run build
2024-04-26 13:41:11 +03:00
WORKDIR /workdir/zot
ARG ZOT_VER=v2.0.4
2024-04-26 13:41:11 +03:00
RUN make COMMIT=$ZOT_VER ZUI_BUILD_PATH="/workdir/zot/zui/build" binary cli bench
2024-04-26 13:41:40 +03:00
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
2024-04-26 13:41:11 +03:00
2024-05-24 18:10:21 +03:00
FROM registry.altlinux.org/alt/alt:sisyphus
2024-04-26 13:41:11 +03:00
MAINTAINER alt-cloud
LABEL org.opencontainers.image.title="zot" \
org.opencontainers.image.description="A production-ready vendor-neutral OCI-native container image registry (purely based on OCI Distribution Specification)" \
org.opencontainers.image.source="https://github.com/project-zot/zot" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.vendor="ALT Linux Team"
2024-04-26 13:41:11 +03:00
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
2024-04-26 13:41:11 +03:00
COPY ./config.json /etc/zot/config.json
2024-04-26 13:41:40 +03:00
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/*.*
2024-05-24 18:10:21 +03:00
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
2024-04-26 13:41:11 +03:00
USER _zot:_zot
VOLUME ["/var/lib/zot"]
EXPOSE 5000
ENTRYPOINT ["/usr/bin/zot"]
CMD ["serve", "/etc/zot/config.json"]