From f62791a8aaaa6e85239c6d3a60b54d74abc9df47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 21 Apr 2015 11:33:52 +0200 Subject: [PATCH] Dockerfile: download go libraries before copy vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When ever something vendor/ changes the go dependencies have to downloaded again, which requires internet access and there for is potential slow. COPY and go install is much faster, while the git urls does not change not this often. Signed-off-by: Jörg Thalheim Upstream-commit: f731b01483ed7010824c5951cc4a27db907c2d47 Component: engine --- components/engine/Dockerfile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/components/engine/Dockerfile b/components/engine/Dockerfile index b1c7c4a6f0..3cfd594191 100644 --- a/components/engine/Dockerfile +++ b/components/engine/Dockerfile @@ -160,20 +160,21 @@ RUN ./contrib/download-frozen-image.sh /docker-frozen-images \ hello-world:frozen@e45a5af57b00862e5ef5782a9925979a02ba2b12dff832fd0991335f4a11e5c5 # see also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is) -# Install man page generator -COPY vendor /go/src/github.com/docker/docker/vendor -# (copy vendor/ because go-md2man needs golang.org/x/net) +# Download man page generator RUN set -x \ && git clone -b v1.0.1 https://github.com/cpuguy83/go-md2man.git /go/src/github.com/cpuguy83/go-md2man \ - && git clone -b v1.2 https://github.com/russross/blackfriday.git /go/src/github.com/russross/blackfriday \ - && go install -v github.com/cpuguy83/go-md2man + && git clone -b v1.2 https://github.com/russross/blackfriday.git /go/src/github.com/russross/blackfriday -# install toml validator +# Download toml validator ENV TOMLV_COMMIT 9baf8a8a9f2ed20a8e54160840c492f937eeaf9a RUN set -x \ && git clone https://github.com/BurntSushi/toml.git /go/src/github.com/BurntSushi/toml \ - && (cd /go/src/github.com/BurntSushi/toml && git checkout -q $TOMLV_COMMIT) \ - && go install -v github.com/BurntSushi/toml/cmd/tomlv + && (cd /go/src/github.com/BurntSushi/toml && git checkout -q $TOMLV_COMMIT) + +# copy vendor/ because go-md2man needs golang.org/x/net +COPY vendor /go/src/github.com/docker/docker/vendor +RUN go install -v github.com/cpuguy83/go-md2man \ + github.com/BurntSushi/toml/cmd/tomlv # Wrap all commands in the "docker-in-docker" script to allow nested containers ENTRYPOINT ["hack/dind"]