Skip to content

Commit

Permalink
Merge pull request moby#29256 from tophj-ibm/ppc64le-move-to-go-bin
Browse files Browse the repository at this point in the history
[ppc64le] use official go 1.7.4 binaries
  • Loading branch information
vieux authored Dec 8, 2016
2 parents 7ea31b4 + 62ab680 commit 9aa0c9a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 89 deletions.
24 changes: 5 additions & 19 deletions Dockerfile.ppc64le
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
29 changes: 1 addition & 28 deletions contrib/builder/deb/ppc64le/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
;;
Expand All @@ -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"

Expand Down
16 changes: 2 additions & 14 deletions contrib/builder/deb/ppc64le/ubuntu-trusty/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 2 additions & 14 deletions contrib/builder/deb/ppc64le/ubuntu-xenial/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 2 additions & 14 deletions contrib/builder/deb/ppc64le/ubuntu-yakkety/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9aa0c9a

Please sign in to comment.