From 1b7e7ea03f5d165be782c7fa297534d8b1b88d18 Mon Sep 17 00:00:00 2001 From: Jonathan Azoff Date: Mon, 23 May 2016 11:50:49 -0700 Subject: [PATCH 01/12] adds zip to 1.6 --- 1.6/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/1.6/Dockerfile b/1.6/Dockerfile index 41c7c61b..a1806283 100644 --- a/1.6/Dockerfile +++ b/1.6/Dockerfile @@ -5,6 +5,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ g++ \ gcc \ libc6-dev \ + zip \ make \ && rm -rf /var/lib/apt/lists/* From 18e2a3c75000c071ccb19e25bfda0ab677bc6a36 Mon Sep 17 00:00:00 2001 From: Jonathan Azoff Date: Wed, 14 Jun 2017 22:46:20 -0700 Subject: [PATCH 02/12] Adds golang 1.8 --- 1.8/Dockerfile | 26 +++++++++++ 1.8/alpine/Dockerfile | 46 ++++++++++++++++++++ 1.8/alpine/no-pic.patch | 16 +++++++ 1.8/go-wrapper | 95 +++++++++++++++++++++++++++++++++++++++++ 1.8/onbuild/Dockerfile | 11 +++++ 1.8/wheezy/Dockerfile | 26 +++++++++++ 1.8/wheezy/go-wrapper | 95 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 315 insertions(+) create mode 100644 1.8/Dockerfile create mode 100644 1.8/alpine/Dockerfile create mode 100644 1.8/alpine/no-pic.patch create mode 100755 1.8/go-wrapper create mode 100644 1.8/onbuild/Dockerfile create mode 100644 1.8/wheezy/Dockerfile create mode 100755 1.8/wheezy/go-wrapper diff --git a/1.8/Dockerfile b/1.8/Dockerfile new file mode 100644 index 00000000..8437463e --- /dev/null +++ b/1.8/Dockerfile @@ -0,0 +1,26 @@ +FROM buildpack-deps:xenial-scm + +RUN apt-get update +RUN apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + zip \ + make +RUN rm -rf /var/lib/apt/lists/* + +ENV GOLANG_VERSION 1.8.3 +ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz + +RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \ + && echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" \ + && tar -C /usr/local -xzf golang.tar.gz \ + && rm golang.tar.gz + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH + +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +WORKDIR $GOPATH + +COPY go-wrapper /usr/local/bin/ diff --git a/1.8/alpine/Dockerfile b/1.8/alpine/Dockerfile new file mode 100644 index 00000000..eb83bfad --- /dev/null +++ b/1.8/alpine/Dockerfile @@ -0,0 +1,46 @@ +FROM alpine:3.3 + +ENV GOLANG_VERSION 1.6.2 +ENV GOLANG_SRC_URL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz +ENV GOLANG_SRC_SHA256 787b0b750d037016a30c6ed05a8a70a91b2e9db4bd9b1a2453aa502a63f1bccc + +ENV GOLANG_BOOTSTRAP_VERSION 1.4.3 +ENV GOLANG_BOOTSTRAP_URL https://golang.org/dl/go$GOLANG_BOOTSTRAP_VERSION.src.tar.gz +ENV GOLANG_BOOTSTRAP_SHA1 486db10dc571a55c8d795365070f66d343458c48 + +# https://golang.org/issue/14851 +COPY no-pic.patch / + +RUN set -ex \ + && apk add --no-cache --virtual .build-deps \ + bash \ + ca-certificates \ + gcc \ + musl-dev \ + openssl \ + \ + && mkdir -p /usr/local/bootstrap \ + && wget -q "$GOLANG_BOOTSTRAP_URL" -O golang.tar.gz \ + && echo "$GOLANG_BOOTSTRAP_SHA1 golang.tar.gz" | sha1sum -c - \ + && tar -C /usr/local/bootstrap -xzf golang.tar.gz \ + && rm golang.tar.gz \ + && cd /usr/local/bootstrap/go/src \ + && ./make.bash \ + && export GOROOT_BOOTSTRAP=/usr/local/bootstrap/go \ + \ + && wget -q "$GOLANG_SRC_URL" -O golang.tar.gz \ + && echo "$GOLANG_SRC_SHA256 golang.tar.gz" | sha256sum -c - \ + && tar -C /usr/local -xzf golang.tar.gz \ + && rm golang.tar.gz \ + && cd /usr/local/go/src \ + && patch -p2 -i /no-pic.patch \ + && ./make.bash \ + \ + && rm -rf /usr/local/bootstrap /usr/local/go/pkg/bootstrap /*.patch \ + && apk del .build-deps + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH + +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.8/alpine/no-pic.patch b/1.8/alpine/no-pic.patch new file mode 100644 index 00000000..db1f809d --- /dev/null +++ b/1.8/alpine/no-pic.patch @@ -0,0 +1,16 @@ +diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go +index 8ccbec9dd634..4e96bfadc260 100644 +--- a/src/cmd/link/internal/ld/lib.go ++++ b/src/cmd/link/internal/ld/lib.go +@@ -1194,6 +1194,11 @@ func hostlink() { + argv = append(argv, peimporteddlls()...) + } + ++ // The Go linker does not currently support building PIE ++ // executables when using the external linker. See: ++ // https://github.com/golang/go/issues/6940 ++ argv = append(argv, "-fno-PIC") ++ + if Debug['v'] != 0 { + fmt.Fprintf(&Bso, "host link:") + for _, v := range argv { diff --git a/1.8/go-wrapper b/1.8/go-wrapper new file mode 100755 index 00000000..97367b71 --- /dev/null +++ b/1.8/go-wrapper @@ -0,0 +1,95 @@ +#!/bin/bash +set -e + +usage() { + base="$(basename "$0")" + cat <&2 + exit 1 +fi + +goDir="$(go list -e -f '{{.ImportComment}}' 2>/dev/null || true)" + +if [ -z "$goDir" -a -s .godir ]; then + goDir="$(cat .godir)" +fi + +dir="$(pwd -P)" +if [ "$goDir" ]; then + goPath="${GOPATH%%:*}" # this just grabs the first path listed in GOPATH, if there are multiple (which is the detection logic "go get" itself uses, too) + goDirPath="$goPath/src/$goDir" + mkdir -p "$(dirname "$goDirPath")" + if [ ! -e "$goDirPath" ]; then + ln -sfv "$dir" "$goDirPath" + elif [ ! -L "$goDirPath" ]; then + echo >&2 "error: $goDirPath already exists but is unexpectedly not a symlink!" + exit 1 + fi + goBin="$goPath/bin/$(basename "$goDir")" +else + goBin="$(basename "$dir")" # likely "app" +fi + +case "$cmd" in + download) + execCommand=( go get -v -d "$@" ) + if [ "$goDir" ]; then execCommand+=( "$goDir" ); fi + set -x; exec "${execCommand[@]}" + ;; + + install) + execCommand=( go install -v "$@" ) + if [ "$goDir" ]; then execCommand+=( "$goDir" ); fi + set -x; exec "${execCommand[@]}" + ;; + + run) + set -x; exec "$goBin" "$@" + ;; + + *) + echo >&2 'error: unknown command:' "$cmd" + usage >&2 + exit 1 + ;; +esac diff --git a/1.8/onbuild/Dockerfile b/1.8/onbuild/Dockerfile new file mode 100644 index 00000000..a854f4b8 --- /dev/null +++ b/1.8/onbuild/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:1.6 + +RUN mkdir -p /go/src/app +WORKDIR /go/src/app + +# this will ideally be built by the ONBUILD below ;) +CMD ["go-wrapper", "run"] + +ONBUILD COPY . /go/src/app +ONBUILD RUN go-wrapper download +ONBUILD RUN go-wrapper install diff --git a/1.8/wheezy/Dockerfile b/1.8/wheezy/Dockerfile new file mode 100644 index 00000000..075b5655 --- /dev/null +++ b/1.8/wheezy/Dockerfile @@ -0,0 +1,26 @@ +FROM buildpack-deps:wheezy-scm + +# gcc for cgo +RUN apt-get update && apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + make \ + && rm -rf /var/lib/apt/lists/* + +ENV GOLANG_VERSION 1.6.2 +ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz +ENV GOLANG_DOWNLOAD_SHA256 e40c36ae71756198478624ed1bb4ce17597b3c19d243f3f0899bb5740d56212a + +RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \ + && echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \ + && tar -C /usr/local -xzf golang.tar.gz \ + && rm golang.tar.gz + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH + +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +WORKDIR $GOPATH + +COPY go-wrapper /usr/local/bin/ diff --git a/1.8/wheezy/go-wrapper b/1.8/wheezy/go-wrapper new file mode 100755 index 00000000..97367b71 --- /dev/null +++ b/1.8/wheezy/go-wrapper @@ -0,0 +1,95 @@ +#!/bin/bash +set -e + +usage() { + base="$(basename "$0")" + cat <&2 + exit 1 +fi + +goDir="$(go list -e -f '{{.ImportComment}}' 2>/dev/null || true)" + +if [ -z "$goDir" -a -s .godir ]; then + goDir="$(cat .godir)" +fi + +dir="$(pwd -P)" +if [ "$goDir" ]; then + goPath="${GOPATH%%:*}" # this just grabs the first path listed in GOPATH, if there are multiple (which is the detection logic "go get" itself uses, too) + goDirPath="$goPath/src/$goDir" + mkdir -p "$(dirname "$goDirPath")" + if [ ! -e "$goDirPath" ]; then + ln -sfv "$dir" "$goDirPath" + elif [ ! -L "$goDirPath" ]; then + echo >&2 "error: $goDirPath already exists but is unexpectedly not a symlink!" + exit 1 + fi + goBin="$goPath/bin/$(basename "$goDir")" +else + goBin="$(basename "$dir")" # likely "app" +fi + +case "$cmd" in + download) + execCommand=( go get -v -d "$@" ) + if [ "$goDir" ]; then execCommand+=( "$goDir" ); fi + set -x; exec "${execCommand[@]}" + ;; + + install) + execCommand=( go install -v "$@" ) + if [ "$goDir" ]; then execCommand+=( "$goDir" ); fi + set -x; exec "${execCommand[@]}" + ;; + + run) + set -x; exec "$goBin" "$@" + ;; + + *) + echo >&2 'error: unknown command:' "$cmd" + usage >&2 + exit 1 + ;; +esac From 38700f8f054fc605a821a682dfadb9c4afabfcf5 Mon Sep 17 00:00:00 2001 From: Jonathan Azoff Date: Wed, 23 Aug 2017 17:54:40 -0700 Subject: [PATCH 03/12] adds awscli to image --- 1.8/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/1.8/Dockerfile b/1.8/Dockerfile index 8437463e..85a08e84 100644 --- a/1.8/Dockerfile +++ b/1.8/Dockerfile @@ -6,7 +6,8 @@ RUN apt-get install -y --no-install-recommends \ gcc \ libc6-dev \ zip \ - make + make \ + awscli RUN rm -rf /var/lib/apt/lists/* ENV GOLANG_VERSION 1.8.3 From e8de65d352a879dafad0ae5b40d45883776efba4 Mon Sep 17 00:00:00 2001 From: Jonathan Azoff Date: Wed, 1 Nov 2017 12:17:14 -0700 Subject: [PATCH 04/12] set up go 1.9.2 --- 1.9/Dockerfile | 36 ++++++++++++++++ 1.9/alpine/Dockerfile | 46 ++++++++++++++++++++ 1.9/alpine/no-pic.patch | 16 +++++++ 1.9/go-wrapper | 95 +++++++++++++++++++++++++++++++++++++++++ 1.9/onbuild/Dockerfile | 11 +++++ 1.9/wheezy/Dockerfile | 26 +++++++++++ 1.9/wheezy/go-wrapper | 95 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 325 insertions(+) create mode 100644 1.9/Dockerfile create mode 100644 1.9/alpine/Dockerfile create mode 100644 1.9/alpine/no-pic.patch create mode 100755 1.9/go-wrapper create mode 100644 1.9/onbuild/Dockerfile create mode 100644 1.9/wheezy/Dockerfile create mode 100755 1.9/wheezy/go-wrapper diff --git a/1.9/Dockerfile b/1.9/Dockerfile new file mode 100644 index 00000000..b5d1fe98 --- /dev/null +++ b/1.9/Dockerfile @@ -0,0 +1,36 @@ +FROM buildpack-deps:xenial-scm + +RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash + +RUN apt-get update +RUN apt-get install -y --no-install-recommends \ + git-lfs \ + postgresql-client \ + g++ \ + gcc \ + libc6-dev \ + zip \ + make \ + awscli +RUN rm -rf /var/lib/apt/lists/* + +ENV DOCKERIZE_VERSION v0.5.0 +RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz + +ENV GOLANG_VERSION 1.9.2 +ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz + +RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \ + && echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" \ + && tar -C /usr/local -xzf golang.tar.gz \ + && rm golang.tar.gz + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH + +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +WORKDIR $GOPATH + +COPY go-wrapper /usr/local/bin/ diff --git a/1.9/alpine/Dockerfile b/1.9/alpine/Dockerfile new file mode 100644 index 00000000..eb83bfad --- /dev/null +++ b/1.9/alpine/Dockerfile @@ -0,0 +1,46 @@ +FROM alpine:3.3 + +ENV GOLANG_VERSION 1.6.2 +ENV GOLANG_SRC_URL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz +ENV GOLANG_SRC_SHA256 787b0b750d037016a30c6ed05a8a70a91b2e9db4bd9b1a2453aa502a63f1bccc + +ENV GOLANG_BOOTSTRAP_VERSION 1.4.3 +ENV GOLANG_BOOTSTRAP_URL https://golang.org/dl/go$GOLANG_BOOTSTRAP_VERSION.src.tar.gz +ENV GOLANG_BOOTSTRAP_SHA1 486db10dc571a55c8d795365070f66d343458c48 + +# https://golang.org/issue/14851 +COPY no-pic.patch / + +RUN set -ex \ + && apk add --no-cache --virtual .build-deps \ + bash \ + ca-certificates \ + gcc \ + musl-dev \ + openssl \ + \ + && mkdir -p /usr/local/bootstrap \ + && wget -q "$GOLANG_BOOTSTRAP_URL" -O golang.tar.gz \ + && echo "$GOLANG_BOOTSTRAP_SHA1 golang.tar.gz" | sha1sum -c - \ + && tar -C /usr/local/bootstrap -xzf golang.tar.gz \ + && rm golang.tar.gz \ + && cd /usr/local/bootstrap/go/src \ + && ./make.bash \ + && export GOROOT_BOOTSTRAP=/usr/local/bootstrap/go \ + \ + && wget -q "$GOLANG_SRC_URL" -O golang.tar.gz \ + && echo "$GOLANG_SRC_SHA256 golang.tar.gz" | sha256sum -c - \ + && tar -C /usr/local -xzf golang.tar.gz \ + && rm golang.tar.gz \ + && cd /usr/local/go/src \ + && patch -p2 -i /no-pic.patch \ + && ./make.bash \ + \ + && rm -rf /usr/local/bootstrap /usr/local/go/pkg/bootstrap /*.patch \ + && apk del .build-deps + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH + +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.9/alpine/no-pic.patch b/1.9/alpine/no-pic.patch new file mode 100644 index 00000000..db1f809d --- /dev/null +++ b/1.9/alpine/no-pic.patch @@ -0,0 +1,16 @@ +diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go +index 8ccbec9dd634..4e96bfadc260 100644 +--- a/src/cmd/link/internal/ld/lib.go ++++ b/src/cmd/link/internal/ld/lib.go +@@ -1194,6 +1194,11 @@ func hostlink() { + argv = append(argv, peimporteddlls()...) + } + ++ // The Go linker does not currently support building PIE ++ // executables when using the external linker. See: ++ // https://github.com/golang/go/issues/6940 ++ argv = append(argv, "-fno-PIC") ++ + if Debug['v'] != 0 { + fmt.Fprintf(&Bso, "host link:") + for _, v := range argv { diff --git a/1.9/go-wrapper b/1.9/go-wrapper new file mode 100755 index 00000000..97367b71 --- /dev/null +++ b/1.9/go-wrapper @@ -0,0 +1,95 @@ +#!/bin/bash +set -e + +usage() { + base="$(basename "$0")" + cat <&2 + exit 1 +fi + +goDir="$(go list -e -f '{{.ImportComment}}' 2>/dev/null || true)" + +if [ -z "$goDir" -a -s .godir ]; then + goDir="$(cat .godir)" +fi + +dir="$(pwd -P)" +if [ "$goDir" ]; then + goPath="${GOPATH%%:*}" # this just grabs the first path listed in GOPATH, if there are multiple (which is the detection logic "go get" itself uses, too) + goDirPath="$goPath/src/$goDir" + mkdir -p "$(dirname "$goDirPath")" + if [ ! -e "$goDirPath" ]; then + ln -sfv "$dir" "$goDirPath" + elif [ ! -L "$goDirPath" ]; then + echo >&2 "error: $goDirPath already exists but is unexpectedly not a symlink!" + exit 1 + fi + goBin="$goPath/bin/$(basename "$goDir")" +else + goBin="$(basename "$dir")" # likely "app" +fi + +case "$cmd" in + download) + execCommand=( go get -v -d "$@" ) + if [ "$goDir" ]; then execCommand+=( "$goDir" ); fi + set -x; exec "${execCommand[@]}" + ;; + + install) + execCommand=( go install -v "$@" ) + if [ "$goDir" ]; then execCommand+=( "$goDir" ); fi + set -x; exec "${execCommand[@]}" + ;; + + run) + set -x; exec "$goBin" "$@" + ;; + + *) + echo >&2 'error: unknown command:' "$cmd" + usage >&2 + exit 1 + ;; +esac diff --git a/1.9/onbuild/Dockerfile b/1.9/onbuild/Dockerfile new file mode 100644 index 00000000..a854f4b8 --- /dev/null +++ b/1.9/onbuild/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:1.6 + +RUN mkdir -p /go/src/app +WORKDIR /go/src/app + +# this will ideally be built by the ONBUILD below ;) +CMD ["go-wrapper", "run"] + +ONBUILD COPY . /go/src/app +ONBUILD RUN go-wrapper download +ONBUILD RUN go-wrapper install diff --git a/1.9/wheezy/Dockerfile b/1.9/wheezy/Dockerfile new file mode 100644 index 00000000..075b5655 --- /dev/null +++ b/1.9/wheezy/Dockerfile @@ -0,0 +1,26 @@ +FROM buildpack-deps:wheezy-scm + +# gcc for cgo +RUN apt-get update && apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + make \ + && rm -rf /var/lib/apt/lists/* + +ENV GOLANG_VERSION 1.6.2 +ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz +ENV GOLANG_DOWNLOAD_SHA256 e40c36ae71756198478624ed1bb4ce17597b3c19d243f3f0899bb5740d56212a + +RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \ + && echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \ + && tar -C /usr/local -xzf golang.tar.gz \ + && rm golang.tar.gz + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH + +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +WORKDIR $GOPATH + +COPY go-wrapper /usr/local/bin/ diff --git a/1.9/wheezy/go-wrapper b/1.9/wheezy/go-wrapper new file mode 100755 index 00000000..97367b71 --- /dev/null +++ b/1.9/wheezy/go-wrapper @@ -0,0 +1,95 @@ +#!/bin/bash +set -e + +usage() { + base="$(basename "$0")" + cat <&2 + exit 1 +fi + +goDir="$(go list -e -f '{{.ImportComment}}' 2>/dev/null || true)" + +if [ -z "$goDir" -a -s .godir ]; then + goDir="$(cat .godir)" +fi + +dir="$(pwd -P)" +if [ "$goDir" ]; then + goPath="${GOPATH%%:*}" # this just grabs the first path listed in GOPATH, if there are multiple (which is the detection logic "go get" itself uses, too) + goDirPath="$goPath/src/$goDir" + mkdir -p "$(dirname "$goDirPath")" + if [ ! -e "$goDirPath" ]; then + ln -sfv "$dir" "$goDirPath" + elif [ ! -L "$goDirPath" ]; then + echo >&2 "error: $goDirPath already exists but is unexpectedly not a symlink!" + exit 1 + fi + goBin="$goPath/bin/$(basename "$goDir")" +else + goBin="$(basename "$dir")" # likely "app" +fi + +case "$cmd" in + download) + execCommand=( go get -v -d "$@" ) + if [ "$goDir" ]; then execCommand+=( "$goDir" ); fi + set -x; exec "${execCommand[@]}" + ;; + + install) + execCommand=( go install -v "$@" ) + if [ "$goDir" ]; then execCommand+=( "$goDir" ); fi + set -x; exec "${execCommand[@]}" + ;; + + run) + set -x; exec "$goBin" "$@" + ;; + + *) + echo >&2 'error: unknown command:' "$cmd" + usage >&2 + exit 1 + ;; +esac From 76696d1519e530a7cdc3e70dc7703ce554c8da07 Mon Sep 17 00:00:00 2001 From: Jonathan Azoff Date: Wed, 1 Nov 2017 14:27:54 -0700 Subject: [PATCH 05/12] adds junit reporter to build --- 1.9/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/1.9/Dockerfile b/1.9/Dockerfile index b5d1fe98..4455383a 100644 --- a/1.9/Dockerfile +++ b/1.9/Dockerfile @@ -31,6 +31,9 @@ ENV GOPATH /go ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" + +RUN go get -u github.com/jstemmer/go-junit-report + WORKDIR $GOPATH COPY go-wrapper /usr/local/bin/ From 8a014df3ee31bdca4cd81d7eded38b0eddafd700 Mon Sep 17 00:00:00 2001 From: Jonathan Azoff Date: Wed, 1 Nov 2017 17:41:32 -0700 Subject: [PATCH 06/12] properly install the junit parser --- 1.9/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/1.9/Dockerfile b/1.9/Dockerfile index 4455383a..10a71772 100644 --- a/1.9/Dockerfile +++ b/1.9/Dockerfile @@ -32,7 +32,10 @@ ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" -RUN go get -u github.com/jstemmer/go-junit-report +RUN go get -u github.com/jstemmer/go-junit-report && \ + cd "${GOPATH}/src/github.com/jstemmer/go-junit-report" && \ + go build && \ + mv go-junit-report /usr/local/bin WORKDIR $GOPATH From 3c38ced38d382aba0a5f9e6c8eb988fad75f21cf Mon Sep 17 00:00:00 2001 From: Scott Delly Date: Tue, 20 Mar 2018 17:14:30 -0700 Subject: [PATCH 07/12] Adds protobuf parsers to go, twirp, swagger --- 1.9/Dockerfile | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/1.9/Dockerfile b/1.9/Dockerfile index 10a71772..cd774c4b 100644 --- a/1.9/Dockerfile +++ b/1.9/Dockerfile @@ -11,7 +11,8 @@ RUN apt-get install -y --no-install-recommends \ libc6-dev \ zip \ make \ - awscli + awscli \ + unzip RUN rm -rf /var/lib/apt/lists/* ENV DOCKERIZE_VERSION v0.5.0 @@ -32,11 +33,42 @@ ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" -RUN go get -u github.com/jstemmer/go-junit-report && \ - cd "${GOPATH}/src/github.com/jstemmer/go-junit-report" && \ +ENV JUNIT_REPORT_LOCATION github.com/jstemmer/go-junit-report +RUN go get -u $JUNIT_REPORT_LOCATION && \ + cd "${GOPATH}/src/$JUNIT_REPORT_LOCATION" && \ go build && \ mv go-junit-report /usr/local/bin +#Install Protocol Buffer Compiler +ENV PROTOC_VERSION 3.5.1 +RUN curl -OL https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip && \ + unzip protoc-$PROTOC_VERSION-linux-x86_64.zip -d protoc && \ + mv protoc/bin/* /usr/local/bin/ && \ + mv protoc/include/* /usr/local/include/ && \ + rm -rf ./protoc && \ + rm protoc-$PROTOC_VERSION-linux-x86_64.zip + +#Install protobuf->Golang generator +ENV GEN_GO_LOCATION github.com/golang/protobuf/protoc-gen-go +RUN go get -u $GEN_GO_LOCATION && \ + cd "${GOPATH}/src/$GEN_GO_LOCATION" && \ + go build && \ + mv protoc-gen-go /usr/local/bin + +#Install protobuf->Twirp generator +ENV GEN_TWIRP_LOCATION github.com/twitchtv/twirp/protoc-gen-twirp +RUN go get -u $GEN_TWIRP_LOCATION && \ + cd "${GOPATH}/src/$GEN_TWIRP_LOCATION" && \ + go build && \ + mv protoc-gen-twirp /usr/local/bin + +#Install protobuf->Swagger generator +ENV GEN_SWAGGER_LOCATION github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger +RUN go get -u $GEN_SWAGGER_LOCATION && \ + cd "${GOPATH}/src/$GEN_SWAGGER_LOCATION" && \ + go build && \ + mv protoc-gen-swagger /usr/local/bin + WORKDIR $GOPATH COPY go-wrapper /usr/local/bin/ From 381289bf87a9b9c6473744699ff1fb99e9690f2a Mon Sep 17 00:00:00 2001 From: Scott Delly Date: Tue, 20 Mar 2018 17:24:16 -0700 Subject: [PATCH 08/12] ignore IDE stuff --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..61069b7a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.idea/* \ No newline at end of file From d8bd7a0f27081cd84e83a11a4dbe6628835693b5 Mon Sep 17 00:00:00 2001 From: Scott Delly Date: Thu, 22 Mar 2018 15:20:34 -0700 Subject: [PATCH 09/12] Add protoc-gen-validators --- 1.9/Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/1.9/Dockerfile b/1.9/Dockerfile index cd774c4b..99f2525a 100644 --- a/1.9/Dockerfile +++ b/1.9/Dockerfile @@ -69,6 +69,13 @@ RUN go get -u $GEN_SWAGGER_LOCATION && \ go build && \ mv protoc-gen-swagger /usr/local/bin +#Install protobuf->Validator generator +ENV GEN_VALIDATORS_LOCATION github.com/mwitkow/go-proto-validators/protoc-gen-govalidators +RUN go get -u $GEN_VALIDATORS_LOCATION && \ + cd "${GOPATH}/src/$GEN_VALIDATORS_LOCATION" && \ + go build && \ + mv protoc-gen-govalidators /usr/local/bin + WORKDIR $GOPATH COPY go-wrapper /usr/local/bin/ From dcc3af96de65d4d450b1e6f4c9b367d4552e1c7e Mon Sep 17 00:00:00 2001 From: Jonathan Azoff Date: Fri, 4 May 2018 13:32:14 -0700 Subject: [PATCH 10/12] adds jq1.5 to the image --- 1.9/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/1.9/Dockerfile b/1.9/Dockerfile index 99f2525a..188198e0 100644 --- a/1.9/Dockerfile +++ b/1.9/Dockerfile @@ -1,6 +1,8 @@ FROM buildpack-deps:xenial-scm RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash +RUN sudo curl -Lo /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 \ + && sudo chmod +x /usr/local/bin/jq RUN apt-get update RUN apt-get install -y --no-install-recommends \ From b9c722f2ba8b9b860570b7539cef850c4bb8f09a Mon Sep 17 00:00:00 2001 From: Jonathan Azoff Date: Fri, 4 May 2018 13:33:05 -0700 Subject: [PATCH 11/12] adds jq1.5 to the image --- 1.9/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1.9/Dockerfile b/1.9/Dockerfile index 188198e0..b234cad7 100644 --- a/1.9/Dockerfile +++ b/1.9/Dockerfile @@ -1,8 +1,8 @@ FROM buildpack-deps:xenial-scm RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash -RUN sudo curl -Lo /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 \ - && sudo chmod +x /usr/local/bin/jq +RUN curl -Lo /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 \ + && chmod +x /usr/local/bin/jq RUN apt-get update RUN apt-get install -y --no-install-recommends \ From 6b6ed4406631500d9bb934e62c680fb77a2d7e1c Mon Sep 17 00:00:00 2001 From: Scott Delly Date: Fri, 7 Sep 2018 16:53:59 -0700 Subject: [PATCH 12/12] Configure go 1.11 for omni-go --- 1.11/stretch/Dockerfile | 54 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/1.11/stretch/Dockerfile b/1.11/stretch/Dockerfile index c38a3176..3de0b1d0 100644 --- a/1.11/stretch/Dockerfile +++ b/1.11/stretch/Dockerfile @@ -1,5 +1,9 @@ FROM buildpack-deps:stretch-scm +RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash +RUN curl -Lo /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 \ + && chmod +x /usr/local/bin/jq + # gcc for cgo RUN apt-get update && apt-get install -y --no-install-recommends \ g++ \ @@ -7,6 +11,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libc6-dev \ make \ pkg-config \ + git-lfs \ + postgresql-client \ + zip \ + awscli \ + unzip \ && rm -rf /var/lib/apt/lists/* ENV GOLANG_VERSION 1.11 @@ -47,4 +56,49 @@ ENV GOPATH /go ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" + + +ENV JUNIT_REPORT_LOCATION github.com/jstemmer/go-junit-report +RUN go get -u $JUNIT_REPORT_LOCATION && \ + cd "${GOPATH}/src/$JUNIT_REPORT_LOCATION" && \ + go build && \ + mv go-junit-report /usr/local/bin + +#Install Protocol Buffer Compiler +ENV PROTOC_VERSION 3.5.1 +RUN curl -OL https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip && \ + unzip protoc-$PROTOC_VERSION-linux-x86_64.zip -d protoc && \ + mv protoc/bin/* /usr/local/bin/ && \ + mv protoc/include/* /usr/local/include/ && \ + rm -rf ./protoc && \ + rm protoc-$PROTOC_VERSION-linux-x86_64.zip + +#Install protobuf->Golang generator +ENV GEN_GO_LOCATION github.com/golang/protobuf/protoc-gen-go +RUN go get -u $GEN_GO_LOCATION && \ + cd "${GOPATH}/src/$GEN_GO_LOCATION" && \ + go build && \ + mv protoc-gen-go /usr/local/bin + +#Install protobuf->Twirp generator +ENV GEN_TWIRP_LOCATION github.com/twitchtv/twirp/protoc-gen-twirp +RUN go get -u $GEN_TWIRP_LOCATION && \ + cd "${GOPATH}/src/$GEN_TWIRP_LOCATION" && \ + go build && \ + mv protoc-gen-twirp /usr/local/bin + +#Install protobuf->Swagger generator +ENV GEN_SWAGGER_LOCATION github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger +RUN go get -u $GEN_SWAGGER_LOCATION && \ + cd "${GOPATH}/src/$GEN_SWAGGER_LOCATION" && \ + go build && \ + mv protoc-gen-swagger /usr/local/bin + +#Install protobuf->Validator generator +ENV GEN_VALIDATORS_LOCATION github.com/mwitkow/go-proto-validators/protoc-gen-govalidators +RUN go get -u $GEN_VALIDATORS_LOCATION && \ + cd "${GOPATH}/src/$GEN_VALIDATORS_LOCATION" && \ + go build && \ + mv protoc-gen-govalidators /usr/local/bin + WORKDIR $GOPATH