Browse code

Refactor Dockerfile version number usage

This refactors version number usage for several of our "download/install this exact version" bits so we have an easier time replacing the version numbers in Jenkins.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>

Tianon Gravi authored on 2015/01/09 15:07:15
Showing 1 changed files
... ...
@@ -62,8 +62,9 @@ RUN cd /usr/local/lvm2 \
62 62
 # see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
63 63
 
64 64
 # Install lxc
65
+ENV LXC_VERSION 1.0.7
65 66
 RUN mkdir -p /usr/src/lxc \
66
-	&& curl -sSL https://linuxcontainers.org/downloads/lxc/lxc-1.0.7.tar.gz | tar -v -C /usr/src/lxc/ -xz --strip-components=1
67
+	&& curl -sSL https://linuxcontainers.org/downloads/lxc/lxc-${LXC_VERSION}.tar.gz | tar -v -C /usr/src/lxc/ -xz --strip-components=1
67 68
 RUN cd /usr/src/lxc \
68 69
 	&& ./configure \
69 70
 	&& make \
... ...
@@ -71,10 +72,11 @@ RUN cd /usr/src/lxc \
71 71
 	&& ldconfig
72 72
 
73 73
 # Install Go
74
-RUN curl -sSL https://golang.org/dl/go1.4.src.tar.gz | tar -v -C /usr/local -xz
75
-ENV PATH /usr/local/go/bin:$PATH
74
+ENV GO_VERSION 1.4
75
+RUN curl -sSL https://golang.org/dl/go${GO_VERSION}.src.tar.gz | tar -v -C /usr/local -xz \
76
+	&& mkdir -p /go/bin
77
+ENV PATH /go/bin:/usr/local/go/bin:$PATH
76 78
 ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
77
-ENV PATH /go/bin:$PATH
78 79
 RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1
79 80
 
80 81
 # Compile Go for cross compilation
... ...
@@ -94,7 +96,7 @@ RUN cd /usr/local/go/src \
94 94
 			./make.bash --no-clean 2>&1; \
95 95
 	done
96 96
 
97
-# reinstall standard library with netgo
97
+# Reinstall standard library with netgo
98 98
 RUN go clean -i net && go install -tags netgo std
99 99
 
100 100
 # Grab Go's cover tool for dead-simple code coverage testing