2020-08-22 04:04:11 +02:00
|
|
|
ARG GO_VERSION=1.15
|
2020-01-29 13:15:29 +01:00
|
|
|
|
2020-08-22 04:04:11 +02:00
|
|
|
FROM golang:${GO_VERSION}-alpine3.12 AS build
|
2015-06-01 12:15:53 +02:00
|
|
|
|
2020-08-24 13:18:39 +02:00
|
|
|
ENV DISTRIBUTION_DIR /go/src/github.com/distribution/distribution
|
2019-01-16 20:14:22 +01:00
|
|
|
ENV BUILDTAGS include_oss include_gcs
|
2015-01-30 00:37:22 +01:00
|
|
|
|
2017-05-23 10:58:05 +02:00
|
|
|
ARG GOOS=linux
|
|
|
|
ARG GOARCH=amd64
|
2018-11-28 19:40:29 +01:00
|
|
|
ARG GOARM=6
|
2019-06-26 23:50:29 +02:00
|
|
|
ARG VERSION
|
|
|
|
ARG REVISION
|
2017-05-23 10:58:05 +02:00
|
|
|
|
2016-07-22 01:14:32 +02:00
|
|
|
RUN set -ex \
|
2018-10-16 00:46:01 +02:00
|
|
|
&& apk add --no-cache make git file
|
2016-07-22 01:14:32 +02:00
|
|
|
|
2015-01-21 04:04:19 +01:00
|
|
|
WORKDIR $DISTRIBUTION_DIR
|
|
|
|
COPY . $DISTRIBUTION_DIR
|
2018-10-16 00:46:01 +02:00
|
|
|
RUN CGO_ENABLED=0 make PREFIX=/go clean binaries && file ./bin/registry | grep "statically linked"
|
2014-12-11 00:57:41 +01:00
|
|
|
|
2020-08-22 04:04:11 +02:00
|
|
|
FROM alpine:3.12
|
2019-01-10 04:47:21 +01:00
|
|
|
|
|
|
|
RUN set -ex \
|
2020-04-16 19:14:56 +02:00
|
|
|
&& apk add --no-cache ca-certificates
|
2019-01-10 04:47:21 +01:00
|
|
|
|
2018-10-16 00:46:01 +02:00
|
|
|
COPY cmd/registry/config-dev.yml /etc/docker/registry/config.yml
|
2020-08-24 13:18:39 +02:00
|
|
|
COPY --from=build /go/src/github.com/distribution/distribution/bin/registry /bin/registry
|
2015-06-11 06:24:16 +02:00
|
|
|
VOLUME ["/var/lib/registry"]
|
2014-12-11 00:57:41 +01:00
|
|
|
EXPOSE 5000
|
2015-04-06 16:05:11 +02:00
|
|
|
ENTRYPOINT ["registry"]
|
2016-01-19 23:26:15 +01:00
|
|
|
CMD ["serve", "/etc/docker/registry/config.yml"]
|