2023-04-17 12:02:21 -04:00
|
|
|
FROM nephatrine/nxbuilder:golang AS builder
|
2020-01-02 18:29:18 -05:00
|
|
|
|
2022-04-21 14:32:08 -04:00
|
|
|
ARG BUILDTAGS="include_oss include_gcs"
|
|
|
|
ARG REGISTRY_VERSION=main
|
|
|
|
ARG REGCLIENT_VERSION=releases/0.4
|
|
|
|
|
2023-04-17 12:02:21 -04:00
|
|
|
RUN git -C ${HOME} clone -b "$REGISTRY_VERSION" --single-branch --depth=1 https://github.com/distribution/distribution.git
|
|
|
|
RUN git -C ${HOME} clone -b "$REGCLIENT_VERSION" --single-branch --depth=1 https://github.com/regclient/regclient.git
|
2022-04-21 14:32:08 -04:00
|
|
|
|
2020-01-04 22:29:30 -05:00
|
|
|
RUN echo "====== COMPILE REGISTRY ======" \
|
2023-04-17 12:02:21 -04:00
|
|
|
&& cd ${HOME}/distribution && go build -trimpath -ldflags "-s -w" -o /usr/bin/registry ./cmd/registry
|
2022-04-21 14:32:08 -04:00
|
|
|
RUN echo "====== COMPILE REGCLIENT ======" \
|
2023-04-17 12:02:21 -04:00
|
|
|
&& cd ${HOME}/regclient && make binaries -j4
|
2022-04-21 14:32:08 -04:00
|
|
|
|
2022-05-14 11:50:37 -04:00
|
|
|
FROM nephatrine/alpine-s6:latest
|
2022-04-21 14:32:08 -04:00
|
|
|
LABEL maintainer="Daniel Wolf <nephatrine@gmail.com>"
|
|
|
|
|
|
|
|
RUN mkdir /etc/registry
|
2022-05-30 17:46:42 -04:00
|
|
|
COPY --from=builder /usr/bin/registry /usr/bin/registry
|
2023-04-17 12:02:21 -04:00
|
|
|
COPY --from=builder /root/regclient/bin/ /usr/local/bin/
|
|
|
|
COPY --from=builder /root/distribution/cmd/registry/config-example.yml /etc/registry/config-example.yml
|
2022-04-21 14:32:08 -04:00
|
|
|
COPY override /
|
|
|
|
|
|
|
|
RUN echo "====== CONFIGURE REGISTRY ======" \
|
2020-01-02 18:29:18 -05:00
|
|
|
&& cp /etc/registry/config-example.yml /etc/registry/config.yml \
|
2020-02-08 17:44:47 -05:00
|
|
|
&& sed -i 's~/var/lib/registry~/mnt/config/data~g' /etc/registry/config.yml \
|
2022-04-21 14:32:08 -04:00
|
|
|
&& sed -i 's~/etc/registry~/mnt/config/etc/registry~g' /etc/registry/config.yml
|
2020-02-08 17:44:47 -05:00
|
|
|
|
2021-08-23 12:20:09 -04:00
|
|
|
EXPOSE 5000/tcp
|