2018-10-15 22:46:01 +00:00
|
|
|
FROM golang:1.11-alpine AS build
|
2015-06-01 10:15:53 +00:00
|
|
|
|
2015-01-21 03:04:19 +00:00
|
|
|
ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution
|
2016-03-11 00:46:43 +00:00
|
|
|
ENV DOCKER_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
|
|
|
|
|
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
|
|
|
|
2018-10-15 22:46:01 +00: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-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"]
|