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