Now that gccgo isn't supported, change the ppc64le dockerfile base image
from a debian:jessie based + gccgo image to a debian:jessie + golang image.
Also includes a go path change to be more consistent across Dockerfiles.
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
| ... | ... |
@@ -15,7 +15,8 @@ |
| 15 | 15 |
# the case. Therefore, you don't have to disable it anymore. |
| 16 | 16 |
# |
| 17 | 17 |
|
| 18 |
-FROM ppc64le/gcc:6.1 |
|
| 18 |
+# ppc64le/golang is a debian:jessie based image with golang installed |
|
| 19 |
+FROM ppc64le/golang:1.6.3 |
|
| 19 | 20 |
|
| 20 | 21 |
# Packaged dependencies |
| 21 | 22 |
RUN apt-get update && apt-get install -y \ |
| ... | ... |
@@ -87,20 +88,26 @@ RUN set -x \ |
| 87 | 87 |
&& rm -rf "$SECCOMP_PATH" |
| 88 | 88 |
|
| 89 | 89 |
|
| 90 |
-## BUILD GOLANG 1.6 |
|
| 90 |
+# Install Go |
|
| 91 |
+# ppc64le doesn't have official go binaries, so use the version of go installed from the image |
|
| 92 |
+# to build go from source. |
|
| 91 | 93 |
# NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6 |
| 92 | 94 |
ENV GO_VERSION 1.7 |
| 93 | 95 |
ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz
|
| 94 |
-ENV GOROOT_BOOTSTRAP /usr/local |
|
| 95 | 96 |
|
| 96 |
-RUN curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \ |
|
| 97 |
- && tar -C /usr/src -xzf golang.tar.gz \ |
|
| 98 |
- && rm golang.tar.gz \ |
|
| 99 |
- && cd /usr/src/go/src && ./make.bash 2>&1 |
|
| 100 |
- |
|
| 101 |
-ENV GOROOT_BOOTSTRAP /usr/src/ |
|
| 102 |
- |
|
| 103 |
-ENV PATH /usr/src/go/bin/:/go/bin:$PATH |
|
| 97 |
+RUN set -x \ |
|
| 98 |
+ && TEMPDIR="$(mktemp -d)" \ |
|
| 99 |
+ && mv /usr/local/go $TEMPDIR \ |
|
| 100 |
+ && GOROOT_BOOTSTRAP=$TEMPDIR/go \ |
|
| 101 |
+ && cd /usr/local \ |
|
| 102 |
+ && curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \ |
|
| 103 |
+ && tar -C /usr/local -xzf golang.tar.gz \ |
|
| 104 |
+ && rm golang.tar.gz \ |
|
| 105 |
+ && cd go/src && ./make.bash 2>&1 \ |
|
| 106 |
+ && rm -rf $TEMPDIR |
|
| 107 |
+ |
|
| 108 |
+ENV GOROOT_BOOTSTRAP /usr/local/go |
|
| 109 |
+ENV PATH /usr/local/go/bin/:$PATH |
|
| 104 | 110 |
ENV GOPATH /go:/go/src/github.com/docker/docker/vendor |
| 105 | 111 |
|
| 106 | 112 |
# Dependency for golint |