diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c7dfb35 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM alpine:3.15 + +RUN apk add --no-cache ca-certificates + +RUN set -eux; \ +# https://github.com/distribution/distribution/releases + version='2.8.0-beta.1'; \ + apkArch="$(apk --print-arch)"; \ + case "$apkArch" in \ + x86_64) arch='amd64'; sha256='d69d68406a30466070d8e47c21fafaadae5c048239df41b50b28a79fa12945ab' ;; \ + aarch64) arch='arm64'; sha256='2a080694ae2528a628245cf5177d4d2e55d430c5dd76cbbf61e5aee08e75abf6' ;; \ + armhf) arch='armv6'; sha256='b5092556fd196f59c7d2a8d4e4460c193588d9f7f39d825d17f299d7fc856ca1' ;; \ + armv7) arch='armv7'; sha256='f479d7d42a4c6086ee9a51f605386fcfb953198bf9ab48c515ffdde33ad46e5d' ;; \ + ppc64le) arch='ppc64le'; sha256='dc0444e672511b4f8dc19fcec1624a33fdaf49a72ff3c1a69bae9bd3399cd074' ;; \ + s390x) arch='s390x'; sha256='4b814d1cb60ee7881e59c1ee52635755c2279196861892cface92e58aa6ac749' ;; \ + *) 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"] diff --git a/amd64/Dockerfile b/amd64/Dockerfile deleted file mode 100644 index 45af236..0000000 --- a/amd64/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM alpine:3.14 AS download -RUN apk add --no-cache tar wget -WORKDIR /out -RUN wget -qO- https://github.com/distribution/distribution/releases/download/v2.8.0-beta.1/registry_2.8.0-beta.1_linux_amd64.tar.gz | tar -zxvf - registry - -FROM alpine:3.14 - -RUN set -ex && apk add --no-cache ca-certificates - -COPY --from=download /out/registry /bin/registry -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"] diff --git a/amd64/config-example.yml b/amd64/config-example.yml deleted file mode 100644 index 3277f9a..0000000 --- a/amd64/config-example.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 0.1 -log: - fields: - service: registry -storage: - cache: - blobdescriptor: inmemory - filesystem: - rootdirectory: /var/lib/registry -http: - addr: :5000 - headers: - X-Content-Type-Options: [nosniff] -health: - storagedriver: - enabled: true - interval: 10s - threshold: 3 diff --git a/amd64/docker-entrypoint.sh b/amd64/docker-entrypoint.sh deleted file mode 100755 index 319d1fd..0000000 --- a/amd64/docker-entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -set -e - -case "$1" in - *.yaml|*.yml) set -- registry serve "$@" ;; - serve|garbage-collect|help|-*) set -- registry "$@" ;; -esac - -exec "$@" diff --git a/arm64/Dockerfile b/arm64/Dockerfile deleted file mode 100644 index 3c3107b..0000000 --- a/arm64/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM alpine:3.14 AS download -RUN apk add --no-cache tar wget -WORKDIR /out -RUN wget -qO- https://github.com/distribution/distribution/releases/download/v2.8.0-beta.1/registry_2.8.0-beta.1_linux_arm64.tar.gz | tar -zxvf - registry - -FROM alpine:3.14 - -RUN set -ex && apk add --no-cache ca-certificates - -COPY --from=download /out/registry /bin/registry -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"] diff --git a/arm64/config-example.yml b/arm64/config-example.yml deleted file mode 100644 index 3277f9a..0000000 --- a/arm64/config-example.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 0.1 -log: - fields: - service: registry -storage: - cache: - blobdescriptor: inmemory - filesystem: - rootdirectory: /var/lib/registry -http: - addr: :5000 - headers: - X-Content-Type-Options: [nosniff] -health: - storagedriver: - enabled: true - interval: 10s - threshold: 3 diff --git a/arm64/docker-entrypoint.sh b/arm64/docker-entrypoint.sh deleted file mode 100755 index 319d1fd..0000000 --- a/arm64/docker-entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -set -e - -case "$1" in - *.yaml|*.yml) set -- registry serve "$@" ;; - serve|garbage-collect|help|-*) set -- registry "$@" ;; -esac - -exec "$@" diff --git a/armv6/Dockerfile b/armv6/Dockerfile deleted file mode 100644 index adcad4a..0000000 --- a/armv6/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM alpine:3.14 AS download -RUN apk add --no-cache tar wget -WORKDIR /out -RUN wget -qO- https://github.com/distribution/distribution/releases/download/v2.8.0-beta.1/registry_2.8.0-beta.1_linux_armv6.tar.gz | tar -zxvf - registry - -FROM alpine:3.14 - -RUN set -ex && apk add --no-cache ca-certificates - -COPY --from=download /out/registry /bin/registry -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"] diff --git a/armv6/config-example.yml b/armv6/config-example.yml deleted file mode 100644 index 3277f9a..0000000 --- a/armv6/config-example.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 0.1 -log: - fields: - service: registry -storage: - cache: - blobdescriptor: inmemory - filesystem: - rootdirectory: /var/lib/registry -http: - addr: :5000 - headers: - X-Content-Type-Options: [nosniff] -health: - storagedriver: - enabled: true - interval: 10s - threshold: 3 diff --git a/armv6/docker-entrypoint.sh b/armv6/docker-entrypoint.sh deleted file mode 100755 index 319d1fd..0000000 --- a/armv6/docker-entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -set -e - -case "$1" in - *.yaml|*.yml) set -- registry serve "$@" ;; - serve|garbage-collect|help|-*) set -- registry "$@" ;; -esac - -exec "$@" diff --git a/armv7/Dockerfile b/armv7/Dockerfile deleted file mode 100644 index ae31f88..0000000 --- a/armv7/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM alpine:3.14 AS download -RUN apk add --no-cache tar wget -WORKDIR /out -RUN wget -qO- https://github.com/distribution/distribution/releases/download/v2.8.0-beta.1/registry_2.8.0-beta.1_linux_armv7.tar.gz | tar -zxvf - registry - -FROM alpine:3.14 - -RUN set -ex && apk add --no-cache ca-certificates - -COPY --from=download /out/registry /bin/registry -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"] diff --git a/armv7/config-example.yml b/armv7/config-example.yml deleted file mode 100644 index 3277f9a..0000000 --- a/armv7/config-example.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 0.1 -log: - fields: - service: registry -storage: - cache: - blobdescriptor: inmemory - filesystem: - rootdirectory: /var/lib/registry -http: - addr: :5000 - headers: - X-Content-Type-Options: [nosniff] -health: - storagedriver: - enabled: true - interval: 10s - threshold: 3 diff --git a/armv7/docker-entrypoint.sh b/armv7/docker-entrypoint.sh deleted file mode 100755 index 319d1fd..0000000 --- a/armv7/docker-entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -set -e - -case "$1" in - *.yaml|*.yml) set -- registry serve "$@" ;; - serve|garbage-collect|help|-*) set -- registry "$@" ;; -esac - -exec "$@" diff --git a/ppc64le/Dockerfile b/ppc64le/Dockerfile deleted file mode 100644 index 4fca6d3..0000000 --- a/ppc64le/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM alpine:3.14 AS download -RUN apk add --no-cache tar wget -WORKDIR /out -RUN wget -qO- https://github.com/distribution/distribution/releases/download/v2.8.0-beta.1/registry_2.8.0-beta.1_linux_ppc64le.tar.gz | tar -zxvf - registry - -FROM alpine:3.14 - -RUN set -ex && apk add --no-cache ca-certificates - -COPY --from=download /out/registry /bin/registry -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"] diff --git a/ppc64le/config-example.yml b/ppc64le/config-example.yml deleted file mode 100644 index 3277f9a..0000000 --- a/ppc64le/config-example.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 0.1 -log: - fields: - service: registry -storage: - cache: - blobdescriptor: inmemory - filesystem: - rootdirectory: /var/lib/registry -http: - addr: :5000 - headers: - X-Content-Type-Options: [nosniff] -health: - storagedriver: - enabled: true - interval: 10s - threshold: 3 diff --git a/ppc64le/docker-entrypoint.sh b/ppc64le/docker-entrypoint.sh deleted file mode 100755 index 319d1fd..0000000 --- a/ppc64le/docker-entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -set -e - -case "$1" in - *.yaml|*.yml) set -- registry serve "$@" ;; - serve|garbage-collect|help|-*) set -- registry "$@" ;; -esac - -exec "$@" diff --git a/s390x/Dockerfile b/s390x/Dockerfile deleted file mode 100644 index aa18754..0000000 --- a/s390x/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM alpine:3.14 AS download -RUN apk add --no-cache tar wget -WORKDIR /out -RUN wget -qO- https://github.com/distribution/distribution/releases/download/v2.8.0-beta.1/registry_2.8.0-beta.1_linux_s390x.tar.gz | tar -zxvf - registry - -FROM alpine:3.14 - -RUN set -ex && apk add --no-cache ca-certificates - -COPY --from=download /out/registry /bin/registry -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"] diff --git a/s390x/config-example.yml b/s390x/config-example.yml deleted file mode 100644 index 3277f9a..0000000 --- a/s390x/config-example.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 0.1 -log: - fields: - service: registry -storage: - cache: - blobdescriptor: inmemory - filesystem: - rootdirectory: /var/lib/registry -http: - addr: :5000 - headers: - X-Content-Type-Options: [nosniff] -health: - storagedriver: - enabled: true - interval: 10s - threshold: 3 diff --git a/s390x/docker-entrypoint.sh b/s390x/docker-entrypoint.sh deleted file mode 100755 index 319d1fd..0000000 --- a/s390x/docker-entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -set -e - -case "$1" in - *.yaml|*.yml) set -- registry serve "$@" ;; - serve|garbage-collect|help|-*) set -- registry "$@" ;; -esac - -exec "$@" diff --git a/update.sh b/update.sh deleted file mode 100755 index f3603a4..0000000 --- a/update.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -: "${ARCHS=amd64,armv6,armv7,arm64,ppc64le,s390x}" - -set -e - -if [ $# -eq 0 ] ; then - echo "Usage: ./update.sh " - exit -fi - -VERSION=$1 - -for arch in ${ARCHS//,/ }; do - echo "Generating distribution dockerfile $VERSION ($arch)..." - mkdir -p "$arch" - cp docker-entrypoint.sh config-example.yml $arch - cat > "$arch/Dockerfile" <