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/*.*
2024-11-15 16:40:30 +03:00
ARG ZOT_ALT_REPO = https://gitea.basealt.ru/alt/zot-wo-auth.git \
ZOT_ALT_BRANCH = zot-alt
2024-05-27 10:43:01 +03:00
RUN git clone -q --branch $ZOT_ALT_BRANCH $ZOT_ALT_REPO zot
2024-11-15 16:40:30 +03:00
2024-04-26 13:41:11 +03:00
WORKDIR zot
2024-11-15 16:40:30 +03:00
ARG ZUI_ALT_BRANCH = zui-alt
2024-05-27 10:43:01 +03:00
RUN git clone -q --branch $ZUI_ALT_BRANCH $ZOT_ALT_REPO zui
2024-04-26 13:41:11 +03:00
WORKDIR zui
2024-11-15 16:40:30 +03:00
RUN npm install && npm run build
2024-04-26 13:41:11 +03:00
WORKDIR /workdir/zot
2024-11-15 16:40:30 +03:00
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
2024-11-15 16:40:48 +03:00
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
2024-11-15 16:40:30 +03:00
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" ]