Browse code

[ppc64le] use official go 1.7.4 binaries

go 1.7.4 introduced official go ppc64le binaries, so use those
instead of using older versions of go and building from src.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
(cherry picked from commit 62ab6809bd0a654dde9c076f5a197253c66877e8)
Signed-off-by: Victor Vieux <vieux@docker.com>

Christopher Jones authored on 2016/12/08 06:49:46
Showing 5 changed files
... ...
@@ -15,8 +15,7 @@
15 15
 # the case. Therefore, you don't have to disable it anymore.
16 16
 #
17 17
 
18
-# ppc64le/golang is a debian:jessie based image with golang installed
19
-FROM ppc64le/golang:1.6.3
18
+FROM ppc64le/debian:jessie
20 19
 
21 20
 # allow replacing httpredir or deb mirror
22 21
 ARG APT_MIRROR=deb.debian.org
... ...
@@ -95,25 +94,12 @@ RUN set -x \
95 95
 
96 96
 
97 97
 # Install Go
98
-# ppc64le doesn't have official go binaries, so use the version of go installed from the image
99
-# to build go from source.
100
-# NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6
98
+# NOTE: official ppc64le go binaries weren't available until go 1.6.4 and 1.7.4
101 99
 ENV GO_VERSION 1.7.4
102
-ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz
100
+RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" \
101
+	| tar -xzC /usr/local
103 102
 
104
-RUN set -x \
105
-	&& TEMPDIR="$(mktemp -d)" \
106
-	&& mv /usr/local/go $TEMPDIR \
107
-	&& GOROOT_BOOTSTRAP=$TEMPDIR/go \
108
-	&& cd /usr/local \
109
-	&& curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \
110
-	&& tar -C /usr/local -xzf golang.tar.gz \
111
-	&& rm golang.tar.gz \
112
-	&& cd go/src && ./make.bash 2>&1 \
113
-	&& rm -rf $TEMPDIR
114
-
115
-ENV GOROOT_BOOTSTRAP /usr/local/go
116
-ENV PATH /usr/local/go/bin/:$PATH
103
+ENV PATH /go/bin:/usr/local/go/bin:$PATH
117 104
 ENV GOPATH /go
118 105
 
119 106
 # Dependency for golint
... ...
@@ -59,22 +59,12 @@ for version in "${versions[@]}"; do
59 59
 		vim-common # tini dep
60 60
 	)
61 61
 
62
-	# trusty uses a different go package name then xenial and newer, so track that for later
63
-	goPackage=
64 62
 	case "$suite" in
65 63
 		trusty) 
66
-			# ppc64le doesn't have go binaries, so install go to bootstrap go
67
-			# trusty doesn't have a ppc64le golang-go package
68
-			packages+=( golang-1.6 )
69
-			goPackage='golang-1.6'
70
-
71 64
 			packages+=( libsystemd-journal-dev )
72 65
 			;;
73 66
 		*)
74 67
 			# libseccomp isn't available until ubuntu xenial and is required for "seccomp.h" & "libseccomp.so"
75
-			packages+=( golang-go )
76
-			goPackage='golang-go'
77
-
78 68
 			packages+=( libseccomp-dev )
79 69
 			packages+=( libsystemd-dev )
80 70
 			;;
... ...
@@ -98,25 +88,8 @@ for version in "${versions[@]}"; do
98 98
 	echo "RUN apt-get update && apt-get install -y ${packages[*]} --no-install-recommends && rm -rf /var/lib/apt/lists/*" >> "$version/Dockerfile"
99 99
 	echo >> "$version/Dockerfile"
100 100
 
101
-	# ppc64le doesn't have an official downloadable binary as of go 1.6.2. so use the
102
-	# older packaged go(v1.6.1) to bootstrap latest go, then remove the packaged go
103
-	echo "# Install Go" >> "$version/Dockerfile"
104
-	echo "# ppc64le doesn't have official go binaries, so use a distro packaged version of go" >> "$version/Dockerfile"
105
-	echo "# to build go from source." >> "$version/Dockerfile"
106
-	echo "# NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6" >> "$version/Dockerfile"
107
-	
108 101
 	awk '$1 == "ENV" && $2 == "GO_VERSION" { print; exit }' ../../../../Dockerfile.ppc64le >> "$version/Dockerfile"
109
-	echo 'ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz' >> "$version/Dockerfile"
110
-	echo 'ENV GOROOT_BOOTSTRAP /usr/lib/go-1.6' >> "$version/Dockerfile"
111
-	echo >> "$version/Dockerfile"
112
-	
113
-	echo 'RUN curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \' >> "$version/Dockerfile"
114
-	echo '	&& tar -C /usr/local -xzf golang.tar.gz \' >> "$version/Dockerfile"
115
-	echo '	&& rm golang.tar.gz \' >> "$version/Dockerfile"
116
-	echo '	&& cd /usr/local/go/src && ./make.bash 2>&1 \' >> "$version/Dockerfile"
117
-	echo "	&& apt-get purge -y $goPackage && apt-get autoremove -y" >> "$version/Dockerfile"
118
-	echo >> "$version/Dockerfile"
119
-
102
+	echo 'RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" | tar xzC /usr/local' >> "$version/Dockerfile"
120 103
 	echo 'ENV PATH $PATH:/usr/local/go/bin' >> "$version/Dockerfile"
121 104
 	echo >> "$version/Dockerfile"
122 105
 
... ...
@@ -4,22 +4,10 @@
4 4
 
5 5
 FROM ppc64le/ubuntu:trusty
6 6
 
7
-RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev pkg-config vim-common golang-1.6 libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
7
+RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev pkg-config vim-common libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
8 8
 
9
-# Install Go
10
-# ppc64le doesn't have official go binaries, so use a distro packaged version of go
11
-# to build go from source.
12
-# NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6
13 9
 ENV GO_VERSION 1.7.4
14
-ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz
15
-ENV GOROOT_BOOTSTRAP /usr/lib/go-1.6
16
-
17
-RUN curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \
18
-	&& tar -C /usr/local -xzf golang.tar.gz \
19
-	&& rm golang.tar.gz \
20
-	&& cd /usr/local/go/src && ./make.bash 2>&1 \
21
-	&& apt-get purge -y golang-1.6 && apt-get autoremove -y
22
-
10
+RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" | tar xzC /usr/local
23 11
 ENV PATH $PATH:/usr/local/go/bin
24 12
 
25 13
 ENV AUTO_GOPATH 1
... ...
@@ -4,22 +4,10 @@
4 4
 
5 5
 FROM ppc64le/ubuntu:xenial
6 6
 
7
-RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev pkg-config vim-common golang-go libseccomp-dev libsystemd-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
7
+RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev pkg-config vim-common libseccomp-dev libsystemd-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
8 8
 
9
-# Install Go
10
-# ppc64le doesn't have official go binaries, so use a distro packaged version of go
11
-# to build go from source.
12
-# NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6
13 9
 ENV GO_VERSION 1.7.4
14
-ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz
15
-ENV GOROOT_BOOTSTRAP /usr/lib/go-1.6
16
-
17
-RUN curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \
18
-	&& tar -C /usr/local -xzf golang.tar.gz \
19
-	&& rm golang.tar.gz \
20
-	&& cd /usr/local/go/src && ./make.bash 2>&1 \
21
-	&& apt-get purge -y golang-go && apt-get autoremove -y
22
-
10
+RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" | tar xzC /usr/local
23 11
 ENV PATH $PATH:/usr/local/go/bin
24 12
 
25 13
 ENV AUTO_GOPATH 1
... ...
@@ -4,22 +4,10 @@
4 4
 
5 5
 FROM ppc64le/ubuntu:yakkety
6 6
 
7
-RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev pkg-config vim-common golang-go libseccomp-dev libsystemd-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
7
+RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential cmake curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev pkg-config vim-common libseccomp-dev libsystemd-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
8 8
 
9
-# Install Go
10
-# ppc64le doesn't have official go binaries, so use a distro packaged version of go
11
-# to build go from source.
12
-# NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6
13 9
 ENV GO_VERSION 1.7.4
14
-ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz
15
-ENV GOROOT_BOOTSTRAP /usr/lib/go-1.6
16
-
17
-RUN curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \
18
-	&& tar -C /usr/local -xzf golang.tar.gz \
19
-	&& rm golang.tar.gz \
20
-	&& cd /usr/local/go/src && ./make.bash 2>&1 \
21
-	&& apt-get purge -y golang-go && apt-get autoremove -y
22
-
10
+RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" | tar xzC /usr/local
23 11
 ENV PATH $PATH:/usr/local/go/bin
24 12
 
25 13
 ENV AUTO_GOPATH 1