From 62ab6809bd0a654dde9c076f5a197253c66877e8 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Wed, 7 Dec 2016 16:49:46 -0500 Subject: [PATCH] [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 --- Dockerfile.ppc64le | 24 ++++----------- contrib/builder/deb/ppc64le/generate.sh | 29 +------------------ .../deb/ppc64le/ubuntu-trusty/Dockerfile | 16 ++-------- .../deb/ppc64le/ubuntu-xenial/Dockerfile | 16 ++-------- .../deb/ppc64le/ubuntu-yakkety/Dockerfile | 16 ++-------- 5 files changed, 12 insertions(+), 89 deletions(-) diff --git a/Dockerfile.ppc64le b/Dockerfile.ppc64le index dd73ed2ec8..dcfc18ed6c 100644 --- a/Dockerfile.ppc64le +++ b/Dockerfile.ppc64le @@ -15,8 +15,7 @@ # the case. Therefore, you don't have to disable it anymore. # -# ppc64le/golang is a debian:jessie based image with golang installed -FROM ppc64le/golang:1.6.3 +FROM ppc64le/debian:jessie # allow replacing httpredir or deb mirror ARG APT_MIRROR=deb.debian.org @@ -95,25 +94,12 @@ RUN set -x \ # Install Go -# ppc64le doesn't have official go binaries, so use the version of go installed from the image -# to build go from source. -# NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6 +# NOTE: official ppc64le go binaries weren't available until go 1.6.4 and 1.7.4 ENV GO_VERSION 1.7.4 -ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz +RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" \ + | tar -xzC /usr/local -RUN set -x \ - && TEMPDIR="$(mktemp -d)" \ - && mv /usr/local/go $TEMPDIR \ - && GOROOT_BOOTSTRAP=$TEMPDIR/go \ - && cd /usr/local \ - && curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \ - && tar -C /usr/local -xzf golang.tar.gz \ - && rm golang.tar.gz \ - && cd go/src && ./make.bash 2>&1 \ - && rm -rf $TEMPDIR - -ENV GOROOT_BOOTSTRAP /usr/local/go -ENV PATH /usr/local/go/bin/:$PATH +ENV PATH /go/bin:/usr/local/go/bin:$PATH ENV GOPATH /go # Dependency for golint diff --git a/contrib/builder/deb/ppc64le/generate.sh b/contrib/builder/deb/ppc64le/generate.sh index 571a67cab7..0e20b9c4b5 100755 --- a/contrib/builder/deb/ppc64le/generate.sh +++ b/contrib/builder/deb/ppc64le/generate.sh @@ -59,22 +59,12 @@ for version in "${versions[@]}"; do vim-common # tini dep ) - # trusty uses a different go package name then xenial and newer, so track that for later - goPackage= case "$suite" in trusty) - # ppc64le doesn't have go binaries, so install go to bootstrap go - # trusty doesn't have a ppc64le golang-go package - packages+=( golang-1.6 ) - goPackage='golang-1.6' - packages+=( libsystemd-journal-dev ) ;; *) # libseccomp isn't available until ubuntu xenial and is required for "seccomp.h" & "libseccomp.so" - packages+=( golang-go ) - goPackage='golang-go' - packages+=( libseccomp-dev ) packages+=( libsystemd-dev ) ;; @@ -98,25 +88,8 @@ for version in "${versions[@]}"; do echo "RUN apt-get update && apt-get install -y ${packages[*]} --no-install-recommends && rm -rf /var/lib/apt/lists/*" >> "$version/Dockerfile" echo >> "$version/Dockerfile" - # ppc64le doesn't have an official downloadable binary as of go 1.6.2. so use the - # older packaged go(v1.6.1) to bootstrap latest go, then remove the packaged go - echo "# Install Go" >> "$version/Dockerfile" - echo "# ppc64le doesn't have official go binaries, so use a distro packaged version of go" >> "$version/Dockerfile" - echo "# to build go from source." >> "$version/Dockerfile" - echo "# NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6" >> "$version/Dockerfile" - awk '$1 == "ENV" && $2 == "GO_VERSION" { print; exit }' ../../../../Dockerfile.ppc64le >> "$version/Dockerfile" - echo 'ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz' >> "$version/Dockerfile" - echo 'ENV GOROOT_BOOTSTRAP /usr/lib/go-1.6' >> "$version/Dockerfile" - echo >> "$version/Dockerfile" - - echo 'RUN curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \' >> "$version/Dockerfile" - echo ' && tar -C /usr/local -xzf golang.tar.gz \' >> "$version/Dockerfile" - echo ' && rm golang.tar.gz \' >> "$version/Dockerfile" - echo ' && cd /usr/local/go/src && ./make.bash 2>&1 \' >> "$version/Dockerfile" - echo " && apt-get purge -y $goPackage && apt-get autoremove -y" >> "$version/Dockerfile" - echo >> "$version/Dockerfile" - + echo 'RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" | tar xzC /usr/local' >> "$version/Dockerfile" echo 'ENV PATH $PATH:/usr/local/go/bin' >> "$version/Dockerfile" echo >> "$version/Dockerfile" diff --git a/contrib/builder/deb/ppc64le/ubuntu-trusty/Dockerfile b/contrib/builder/deb/ppc64le/ubuntu-trusty/Dockerfile index 790464acf1..27e1adad53 100644 --- a/contrib/builder/deb/ppc64le/ubuntu-trusty/Dockerfile +++ b/contrib/builder/deb/ppc64le/ubuntu-trusty/Dockerfile @@ -4,22 +4,10 @@ FROM ppc64le/ubuntu:trusty -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/* +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/* -# Install Go -# ppc64le doesn't have official go binaries, so use a distro packaged version of go -# to build go from source. -# NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6 ENV GO_VERSION 1.7.4 -ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz -ENV GOROOT_BOOTSTRAP /usr/lib/go-1.6 - -RUN curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \ - && tar -C /usr/local -xzf golang.tar.gz \ - && rm golang.tar.gz \ - && cd /usr/local/go/src && ./make.bash 2>&1 \ - && apt-get purge -y golang-1.6 && apt-get autoremove -y - +RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 diff --git a/contrib/builder/deb/ppc64le/ubuntu-xenial/Dockerfile b/contrib/builder/deb/ppc64le/ubuntu-xenial/Dockerfile index a9307c1a7b..1057d32a6d 100644 --- a/contrib/builder/deb/ppc64le/ubuntu-xenial/Dockerfile +++ b/contrib/builder/deb/ppc64le/ubuntu-xenial/Dockerfile @@ -4,22 +4,10 @@ FROM ppc64le/ubuntu:xenial -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/* +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/* -# Install Go -# ppc64le doesn't have official go binaries, so use a distro packaged version of go -# to build go from source. -# NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6 ENV GO_VERSION 1.7.4 -ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz -ENV GOROOT_BOOTSTRAP /usr/lib/go-1.6 - -RUN curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \ - && tar -C /usr/local -xzf golang.tar.gz \ - && rm golang.tar.gz \ - && cd /usr/local/go/src && ./make.bash 2>&1 \ - && apt-get purge -y golang-go && apt-get autoremove -y - +RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 diff --git a/contrib/builder/deb/ppc64le/ubuntu-yakkety/Dockerfile b/contrib/builder/deb/ppc64le/ubuntu-yakkety/Dockerfile index b6aa034752..0d7c2b2782 100644 --- a/contrib/builder/deb/ppc64le/ubuntu-yakkety/Dockerfile +++ b/contrib/builder/deb/ppc64le/ubuntu-yakkety/Dockerfile @@ -4,22 +4,10 @@ FROM ppc64le/ubuntu:yakkety -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/* +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/* -# Install Go -# ppc64le doesn't have official go binaries, so use a distro packaged version of go -# to build go from source. -# NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6 ENV GO_VERSION 1.7.4 -ENV GO_DOWNLOAD_URL https://golang.org/dl/go${GO_VERSION}.src.tar.gz -ENV GOROOT_BOOTSTRAP /usr/lib/go-1.6 - -RUN curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \ - && tar -C /usr/local -xzf golang.tar.gz \ - && rm golang.tar.gz \ - && cd /usr/local/go/src && ./make.bash 2>&1 \ - && apt-get purge -y golang-go && apt-get autoremove -y - +RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" | tar xzC /usr/local ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1