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