Skip to content

Commit

Permalink
Use ubuntu xenial as build base
Browse files Browse the repository at this point in the history
  • Loading branch information
jmattheis committed Sep 23, 2020
1 parent 556acbb commit 85c13c8
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.linux-386
Original file line number Diff line number Diff line change
@@ -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
Expand Down
39 changes: 37 additions & 2 deletions Dockerfile.linux-amd64
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.linux-arm-7
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.linux-arm64
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.windows-386
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.windows-amd64
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 85c13c8

Please sign in to comment.