2019-03-04 06:51:01 +00:00
|
|
|
FROM golang:1.11-alpine AS build
|
2019-01-12 04:58:27 +00:00
|
|
|
|
|
|
|
ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution
|
|
|
|
ENV DOCKER_BUILDTAGS include_oss include_gcs
|
|
|
|
|
2019-03-04 06:51:01 +00:00
|
|
|
ARG GOOS=linux
|
|
|
|
ARG GOARCH=amd64
|
|
|
|
ARG GOARM=6
|
|
|
|
|
2019-01-12 04:58:27 +00:00
|
|
|
RUN set -ex \
|
2019-03-04 06:51:01 +00:00
|
|
|
&& apk add --no-cache make git file
|
2019-01-12 04:58:27 +00:00
|
|
|
|
|
|
|
WORKDIR $DISTRIBUTION_DIR
|
|
|
|
COPY . $DISTRIBUTION_DIR
|
2019-03-04 06:51:01 +00:00
|
|
|
RUN CGO_ENABLED=0 make PREFIX=/go clean binaries && file ./bin/registry | grep "statically linked"
|
2019-01-12 04:58:27 +00:00
|
|
|
|
2019-03-04 06:51: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
|
2019-01-12 04:58:27 +00:00
|
|
|
VOLUME ["/var/lib/registry"]
|
|
|
|
EXPOSE 5000
|
|
|
|
ENTRYPOINT ["registry"]
|
|
|
|
CMD ["serve", "/etc/docker/registry/config.yml"]
|