2024-01-11 10:33:45 +01:00
|
|
|
FROM alpine:3.19
|
2022-01-21 19:26:28 +01:00
|
|
|
|
|
|
|
RUN apk add --no-cache ca-certificates
|
|
|
|
|
|
|
|
RUN set -eux; \
|
|
|
|
# https://github.com/distribution/distribution/releases
|
2023-12-19 17:10:45 +01:00
|
|
|
version='3.0.0-alpha.1'; \
|
2022-01-21 19:26:28 +01:00
|
|
|
apkArch="$(apk --print-arch)"; \
|
|
|
|
case "$apkArch" in \
|
2023-12-19 17:10:45 +01:00
|
|
|
x86_64) arch='amd64'; sha256='968a6dcc648aa842963ae00a28128200b6134732ff73db6fc1e52c6f9099d1f9' ;; \
|
|
|
|
aarch64) arch='arm64'; sha256='4f0d3ab06b8f77abf5ae39f08a214c2451b9eec4b1b9bb2eb9b9b9da3a3ad4cf' ;; \
|
|
|
|
armhf) arch='armv6'; sha256='5ac4ac9cd5c7c658cd719efc44a67a0ef4b03e0618aa359ae726938eade66300' ;; \
|
|
|
|
armv7) arch='armv7'; sha256='3c2eb167a162a17453dee0e43fb97b5abb771decf60b492e2867a2354fd0618d' ;; \
|
|
|
|
ppc64le) arch='ppc64le'; sha256='1e39ce43428437faf31f5df636d94c4dc21958076ebf96c1bd3baf67c3f7199a' ;; \
|
|
|
|
s390x) arch='s390x'; sha256='94c53ba2254013b3e38d0c0a8d8005e41681f1f394c23a61db9953d61c134c07' ;; \
|
2022-01-21 19:26:28 +01:00
|
|
|
*) echo >&2 "error: unsupported architecture: $apkArch"; exit 1 ;; \
|
|
|
|
esac; \
|
|
|
|
wget -O registry.tar.gz "https://github.com/distribution/distribution/releases/download/v${version}/registry_${version}_linux_${arch}.tar.gz"; \
|
|
|
|
echo "$sha256 *registry.tar.gz" | sha256sum -c -; \
|
|
|
|
tar --extract --verbose --file registry.tar.gz --directory /bin/ registry; \
|
|
|
|
rm registry.tar.gz; \
|
|
|
|
registry --version
|
|
|
|
|
|
|
|
COPY ./config-example.yml /etc/docker/registry/config.yml
|
|
|
|
|
|
|
|
VOLUME ["/var/lib/registry"]
|
|
|
|
EXPOSE 5000
|
|
|
|
|
|
|
|
COPY docker-entrypoint.sh /entrypoint.sh
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
|
|
|
|
CMD ["/etc/docker/registry/config.yml"]
|