@@ -6,7 +6,7 @@ ARG XX_VERSION=1.9.0
66
77ARG BUILDKIT_VERSION=v0.29.0-rc1
88ARG BUILDX_VERSION=v0.33.0-rc1
9- ARG REGISTRY_VERSION=v2.8.3
9+ ARG REGISTRY_VERSION=v3.0.0
1010
1111# named contexts
1212FROM scratch AS buildkit-binaries
@@ -16,11 +16,9 @@ FROM scratch AS tests-results
1616# xx is a helper for cross-compilation
1717FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
1818
19- # default buildkit
2019FROM moby/buildkit:${BUILDKIT_VERSION} AS buildkit
21-
22- # default buildx
2320FROM docker/buildx-bin:${BUILDX_VERSION#v} AS buildx
21+ FROM registry:${REGISTRY_VERSION#v} AS registry
2422
2523# go base image
2624FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS golatest
@@ -30,22 +28,6 @@ FROM golatest AS gobuild-base
3028RUN apk add --no-cache file bash clang lld musl-dev pkgconfig git make tree findutils
3129COPY --link --from=xx / /
3230
33- FROM gobuild-base AS registry
34- WORKDIR /go/src/github.com/docker/distribution
35- ARG REGISTRY_VERSION
36- ADD --keep-git-dir=true "https://github.com/distribution/distribution.git#$REGISTRY_VERSION" .
37- ARG TARGETPLATFORM
38- RUN --mount=type=cache,target=/root/.cache <<EOT
39- set -ex
40- mkdir /out
41- export GOPATH="$(pwd)/Godeps/_workspace:$GOPATH"
42- GO111MODULE=off CGO_ENABLED=0 xx-go build -o /out/registry ./cmd/registry
43- xx-verify --static /out/registry
44- if [ "$(xx-info os)" = "windows" ]; then
45- mv /out/registry /out/registry.exe
46- fi
47- EOT
48-
4931FROM gobuild-base AS gotestmetrics
5032WORKDIR /src
5133ENV GOFLAGS=-mod=vendor
@@ -137,7 +119,7 @@ FROM scratch AS tests-gen
137119COPY --from=tests-gen-run /out /
138120
139121FROM scratch AS binaries
140- COPY --link --from=registry /out /
122+ COPY --link --from=registry /bin/registry /
141123COPY --link --from=gotestmetrics /out /
142124
143125FROM gobuild-base AS tests-base
0 commit comments