diff --git a/Dockerfile.linux-386 b/Dockerfile.linux-386 index 2efcbd9..f139f8f 100644 --- a/Dockerfile.linux-386 +++ b/Dockerfile.linux-386 @@ -1,5 +1,5 @@ ARG GO_VERSION -FROM golang:$GO_VERSION +FROM gotify/build:$GO_VERSION-linux-amd64 RUN \ apt-get update && \ apt-get install -y libc6-dev-i386 diff --git a/Dockerfile.linux-amd64 b/Dockerfile.linux-amd64 index 61bc46f..6365a5a 100644 --- a/Dockerfile.linux-amd64 +++ b/Dockerfile.linux-amd64 @@ -1,5 +1,40 @@ -ARG GO_VERSION -FROM golang:$GO_VERSION +FROM buildpack-deps:16.04-scm + +RUN apt-get update && apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + make \ + pkg-config \ + && rm -rf /var/lib/apt/lists/* + +ENV PATH /usr/local/go/bin:$PATH +ENV GOLANG_VERSION 1.15.2 + +RUN set -eux; \ + \ + dpkgArch="$(dpkg --print-architecture)"; \ + url='https://storage.googleapis.com/golang/go1.15.2.linux-amd64.tar.gz'; \ + sha256='b49fda1ca29a1946d6bb2a5a6982cf07ccd2aba849289508ee0f9918f6bb4552'; \ + wget -O go.tgz.asc "$url.asc" --progress=dot:giga; \ + wget -O go.tgz "$url" --progress=dot:giga; \ + echo "$sha256 *go.tgz" | sha256sum --strict --check -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + export GNUPGHOME="$(mktemp -d)"; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + go version + +ENV GOPATH /go +ENV PATH $GOPATH/bin:$PATH +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +WORKDIR $GOPATH ENV CGO_ENABLED=1 ENV GOOS=linux diff --git a/Dockerfile.linux-arm-7 b/Dockerfile.linux-arm-7 index f982117..8a044b3 100644 --- a/Dockerfile.linux-arm-7 +++ b/Dockerfile.linux-arm-7 @@ -1,5 +1,5 @@ ARG GO_VERSION -FROM golang:$GO_VERSION +FROM gotify/build:$GO_VERSION-linux-amd64 RUN \ apt-get update && \ apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf diff --git a/Dockerfile.linux-arm64 b/Dockerfile.linux-arm64 index fbd2379..35a6579 100644 --- a/Dockerfile.linux-arm64 +++ b/Dockerfile.linux-arm64 @@ -1,5 +1,5 @@ ARG GO_VERSION -FROM golang:$GO_VERSION +FROM gotify/build:$GO_VERSION-linux-amd64 RUN \ apt-get update && \ apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu diff --git a/Dockerfile.windows-386 b/Dockerfile.windows-386 index 22a1eaa..58478a6 100644 --- a/Dockerfile.windows-386 +++ b/Dockerfile.windows-386 @@ -1,5 +1,5 @@ ARG GO_VERSION -FROM golang:$GO_VERSION +FROM gotify/build:$GO_VERSION-linux-amd64 RUN \ apt-get update && \ apt-get install -y mingw-w64 diff --git a/Dockerfile.windows-amd64 b/Dockerfile.windows-amd64 index ebe90a7..6efea3b 100644 --- a/Dockerfile.windows-amd64 +++ b/Dockerfile.windows-amd64 @@ -1,5 +1,5 @@ ARG GO_VERSION -FROM golang:$GO_VERSION +FROM gotify/build:$GO_VERSION-linux-amd64 RUN \ apt-get update && \ apt-get install -y mingw-w64