Skip to content

Commit f30f9e1

Browse files
authored
Merge pull request #454 from crazy-max/registry-3.0.0
dockerfile: update registry v3.0.0
2 parents de4722c + 820a4c4 commit f30f9e1

1 file changed

Lines changed: 3 additions & 21 deletions

File tree

Dockerfile

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ARG XX_VERSION=1.9.0
66

77
ARG BUILDKIT_VERSION=v0.29.0-rc1
88
ARG BUILDX_VERSION=v0.33.0-rc1
9-
ARG REGISTRY_VERSION=v2.8.3
9+
ARG REGISTRY_VERSION=v3.0.0
1010

1111
# named contexts
1212
FROM scratch AS buildkit-binaries
@@ -16,11 +16,9 @@ FROM scratch AS tests-results
1616
# xx is a helper for cross-compilation
1717
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
1818

19-
# default buildkit
2019
FROM moby/buildkit:${BUILDKIT_VERSION} AS buildkit
21-
22-
# default buildx
2320
FROM docker/buildx-bin:${BUILDX_VERSION#v} AS buildx
21+
FROM registry:${REGISTRY_VERSION#v} AS registry
2422

2523
# go base image
2624
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS golatest
@@ -30,22 +28,6 @@ FROM golatest AS gobuild-base
3028
RUN apk add --no-cache file bash clang lld musl-dev pkgconfig git make tree findutils
3129
COPY --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-
4931
FROM gobuild-base AS gotestmetrics
5032
WORKDIR /src
5133
ENV GOFLAGS=-mod=vendor
@@ -137,7 +119,7 @@ FROM scratch AS tests-gen
137119
COPY --from=tests-gen-run /out /
138120

139121
FROM scratch AS binaries
140-
COPY --link --from=registry /out /
122+
COPY --link --from=registry /bin/registry /
141123
COPY --link --from=gotestmetrics /out /
142124

143125
FROM gobuild-base AS tests-base

0 commit comments

Comments
 (0)