1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Dockerfile: update test-registries to released versions

- using v2.1.0 for the "v1" registry (last release with only v1)
- using v2.3.0 as "current" version (was v2.3.0-rc.0)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2021-09-24 16:47:18 +02:00
parent b954e4793b
commit ce715505bd
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -31,29 +31,29 @@ RUN --mount=type=cache,sharing=locked,id=moby-criu-aptlib,target=/var/lib/apt \
FROM base AS registry FROM base AS registry
WORKDIR /go/src/github.com/docker/distribution WORKDIR /go/src/github.com/docker/distribution
# REGISTRY_COMMIT specifies the version of the registry to build and install # REGISTRY_VERSION specifies the version of the registry to build and install
# from the https://github.com/docker/distribution repository. This version of # from the https://github.com/docker/distribution repository. This version of
# the registry is used to test both schema 1 and schema 2 manifests. Generally, # the registry is used to test both schema 1 and schema 2 manifests. Generally,
# the version specified here should match a current release. # the version specified here should match a current release.
ARG REGISTRY_COMMIT=47a064d4195a9b56133891bbb13620c3ac83a827 ARG REGISTRY_VERSION=v2.3.0
# REGISTRY_COMMIT_SCHEMA1 specifies the version of the regsitry to build and # REGISTRY_VERSION_SCHEMA1 specifies the version of the regsitry to build and
# install from the https://github.com/docker/distribution repository. This is # install from the https://github.com/docker/distribution repository. This is
# an older (pre v2.3.0) version of the registry that only supports schema1 # an older (pre v2.3.0) version of the registry that only supports schema1
# manifests. This version of the registry is not working on arm64, so installation # manifests. This version of the registry is not working on arm64, so installation
# is skipped on that architecture. # is skipped on that architecture.
ARG REGISTRY_COMMIT_SCHEMA1=ec87e9b6971d831f0eff752ddb54fb64693e51cd ARG REGISTRY_VERSION_SCHEMA1=v2.1.0
RUN --mount=type=cache,target=/root/.cache/go-build \ RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/go/pkg/mod \
--mount=type=tmpfs,target=/go/src/ \ --mount=type=tmpfs,target=/go/src/ \
set -x \ set -x \
&& git clone https://github.com/docker/distribution.git . \ && git clone https://github.com/docker/distribution.git . \
&& git checkout -q "$REGISTRY_COMMIT" \ && git checkout -q "$REGISTRY_VERSION" \
&& GOPATH="/go/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \ && GOPATH="/go/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
go build -buildmode=pie -o /build/registry-v2 github.com/docker/distribution/cmd/registry \ go build -buildmode=pie -o /build/registry-v2 github.com/docker/distribution/cmd/registry \
&& case $(dpkg --print-architecture) in \ && case $(dpkg --print-architecture) in \
amd64|armhf|ppc64*|s390x) \ amd64|armhf|ppc64*|s390x) \
git checkout -q "$REGISTRY_COMMIT_SCHEMA1"; \ git checkout -q "$REGISTRY_VERSION_SCHEMA1"; \
GOPATH="/go/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH"; \ GOPATH="/go/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH"; \
go build -buildmode=pie -o /build/registry-v2-schema1 github.com/docker/distribution/cmd/registry; \ go build -buildmode=pie -o /build/registry-v2-schema1 github.com/docker/distribution/cmd/registry; \
;; \ ;; \