From 037a8a11e84f7bc5448ed74c9cf06d86f2405528 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 20 Jan 2015 20:04:19 -0700 Subject: [PATCH] Update the Dockerfile to use the Godeps versions of libraries and to explicitly use golang:1.4 This speeds up the build (and makes it more consistent) since it doesn't have to clone a bunch of repos. :+1: Signed-off-by: Andrew "Tianon" Page --- Dockerfile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 25f31529b..30363eae8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,16 @@ -FROM golang - -COPY . /go/src/github.com/docker/distribution - -# Fetch any dependencies to run the registry -RUN go get github.com/docker/distribution/... -RUN go install github.com/docker/distribution/cmd/registry +FROM golang:1.4 ENV CONFIG_PATH /etc/docker/registry/config.yml -COPY ./cmd/registry/config.yml $CONFIG_PATH +RUN mkdir -pv "$(dirname $CONFIG_PATH)" + +ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution +WORKDIR $DISTRIBUTION_DIR +COPY . $DISTRIBUTION_DIR +ENV GOPATH $GOPATH:$DISTRIBUTION_DIR/Godeps/_workspace + +RUN go install -v ./cmd/registry + +RUN cp -lv ./cmd/registry/config.yml $CONFIG_PATH EXPOSE 5000 -ENV PATH /go/bin CMD registry $CONFIG_PATH