diff --git a/.gitignore b/.gitignore index 2998ab7..c1577f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.swp +*.swo /build/ /env/ diff --git a/.travis.yml b/.travis.yml index f63a4e6..cd148a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,9 @@ go: script: - make pull-images # uncomment to build fresh images - # - docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" - # - make images - # - make push-images + #- docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" + #- make images + #- make push-images - make deps - make diff --git a/docker/xgo-image-deb6/base/Dockerfile b/docker/xgo-image-deb6/base/Dockerfile index beae819..dba030d 100644 --- a/docker/xgo-image-deb6/base/Dockerfile +++ b/docker/xgo-image-deb6/base/Dockerfile @@ -31,6 +31,11 @@ ADD bootstrap.sh /bootstrap.sh ENV BOOTSTRAP /bootstrap.sh RUN chmod +x $BOOTSTRAP +# Inject the new Go root distribution downloader and secondary bootstrapper +ADD bootstrap_pure.sh /bootstrap_pure.sh +ENV BOOTSTRAP_PURE /bootstrap_pure.sh +RUN chmod +x $BOOTSTRAP_PURE + # Inject the C dependency cross compiler ADD build_deps.sh /build_deps.sh ENV BUILD_DEPS /build_deps.sh diff --git a/docker/xgo-image-deb6/base/bootstrap_pure.sh b/docker/xgo-image-deb6/base/bootstrap_pure.sh new file mode 100644 index 0000000..aa40cd4 --- /dev/null +++ b/docker/xgo-image-deb6/base/bootstrap_pure.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Contains the Go tool-chain pure-Go bootstrapper, that as of Go 1.5, initiates +# not only a few pre-built Go cross compilers, but rather bootstraps all of the +# supported platforms from the origin Linux amd64 distribution. +# +# Usage: bootstrap.sh +# +# Needed environment variables: +# FETCH - Remote file fetcher and checksum verifier (injected by image) +# ROOT_DIST - 64 bit Linux Go binary distribution package +# ROOT_DIST_SHA1 - 64 bit Linux Go distribution package checksum +set -e + +# Download, verify and install the root distribution +$FETCH $ROOT_DIST $ROOT_DIST_SHA1 + +tar -C /usr/local -xzf `basename $ROOT_DIST` +rm -f `basename $ROOT_DIST` + +export GOROOT=/usr/local/go +export GOROOT_BOOTSTRAP=$GOROOT + +# Pre-build all guest distributions based on the root distribution +echo "Bootstrapping linux/386..." +GOOS=linux GOARCH=386 CGO_ENABLED=1 go install std diff --git a/docker/xgo-image-deb6/beats-builder/Dockerfile b/docker/xgo-image-deb6/beats-builder/Dockerfile index d50fdce..b1af9d6 100644 --- a/docker/xgo-image-deb6/beats-builder/Dockerfile +++ b/docker/xgo-image-deb6/beats-builder/Dockerfile @@ -1,4 +1,4 @@ -FROM tudorg/xgo-deb6-1.4.2 +FROM tudorg/xgo-deb6-1.5.1 MAINTAINER Tudor Golubenco diff --git a/docker/xgo-image-deb6/build.sh b/docker/xgo-image-deb6/build.sh index c84d071..a58b5db 100755 --- a/docker/xgo-image-deb6/build.sh +++ b/docker/xgo-image-deb6/build.sh @@ -1,5 +1,5 @@ #!/bin/sh docker build --rm=true -t tudorg/xgo-deb6-base base/ && \ - docker build --rm=true -t tudorg/xgo-deb6-1.4.2 go-1.4.2/ && + docker build --rm=true -t tudorg/xgo-deb6-1.5.1 go-1.5.1/ && docker build --rm=true -t tudorg/beats-builder-deb6 beats-builder diff --git a/docker/xgo-image-deb6/go-1.4.2/Dockerfile b/docker/xgo-image-deb6/go-1.4.2/Dockerfile deleted file mode 100644 index 6b85b79..0000000 --- a/docker/xgo-image-deb6/go-1.4.2/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# Go cross compiler (xgo): Go 1.4.2 layer -# Copyright (c) 2014 Péter Szilágyi. All rights reserved. -# -# Released under the MIT license. - -FROM tudorg/xgo-deb6-base - -MAINTAINER Tudor Golubenco - -# Configure the Go packages and bootstrap them -RUN \ - export DIST_LINUX_64=https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz && \ - export DIST_LINUX_64_SHA1=5020af94b52b65cc9b6f11d50a67e4bae07b0aff && \ - \ - export DIST_LINUX_32=https://storage.googleapis.com/golang/go1.4.2.linux-386.tar.gz && \ - export DIST_LINUX_32_SHA1=50557248e89b6e38d395fda93b2f96b2b860a26a && \ - \ - $BOOTSTRAP diff --git a/docker/xgo-image-deb6/go-1.5.1/Dockerfile b/docker/xgo-image-deb6/go-1.5.1/Dockerfile new file mode 100644 index 0000000..13f873b --- /dev/null +++ b/docker/xgo-image-deb6/go-1.5.1/Dockerfile @@ -0,0 +1,15 @@ +# Go cross compiler (xgo): Go 1.5.1 layer +# Copyright (c) 2014 Péter Szilágyi. All rights reserved. +# +# Released under the MIT license. + +FROM tudorg/xgo-deb6-base + +MAINTAINER Tudor Golubenco + +# Configure the root Go distribution and bootstrap based on it +RUN \ + export ROOT_DIST=https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz && \ + export ROOT_DIST_SHA1=46eecd290d8803887dec718c691cc243f2175fe0 && \ + \ + $BOOTSTRAP_PURE diff --git a/docker/xgo-image/base/Dockerfile b/docker/xgo-image/base/Dockerfile index 654ad10..d2fdb61 100644 --- a/docker/xgo-image/base/Dockerfile +++ b/docker/xgo-image/base/Dockerfile @@ -49,6 +49,11 @@ ADD bootstrap.sh /bootstrap.sh ENV BOOTSTRAP /bootstrap.sh RUN chmod +x $BOOTSTRAP +# Inject the new Go root distribution downloader and secondary bootstrapper +ADD bootstrap_pure.sh /bootstrap_pure.sh +ENV BOOTSTRAP_PURE /bootstrap_pure.sh +RUN chmod +x $BOOTSTRAP_PURE + # Inject the C dependency cross compiler ADD build_deps.sh /build_deps.sh ENV BUILD_DEPS /build_deps.sh diff --git a/docker/xgo-image/base/bootstrap.sh b/docker/xgo-image/base/bootstrap.sh index 24c11ab..b0d44a0 100644 --- a/docker/xgo-image/base/bootstrap.sh +++ b/docker/xgo-image/base/bootstrap.sh @@ -19,9 +19,7 @@ set -e # Download and verify all the binary packages $FETCH $DIST_LINUX_64 $DIST_LINUX_64_SHA1 $FETCH $DIST_LINUX_32 $DIST_LINUX_32_SHA1 -$FETCH $DIST_LINUX_ARM $DIST_LINUX_ARM_SHA1 $FETCH $DIST_OSX_64 $DIST_OSX_64_SHA1 -$FETCH $DIST_OSX_32 $DIST_OSX_32_SHA1 $FETCH $DIST_WIN_64 $DIST_WIN_64_SHA1 $FETCH $DIST_WIN_32 $DIST_WIN_32_SHA1 diff --git a/docker/xgo-image/base/bootstrap_pure.sh b/docker/xgo-image/base/bootstrap_pure.sh new file mode 100644 index 0000000..98b04d3 --- /dev/null +++ b/docker/xgo-image/base/bootstrap_pure.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# Contains the Go tool-chain pure-Go bootstrapper, that as of Go 1.5, initiates +# not only a few pre-built Go cross compilers, but rather bootstraps all of the +# supported platforms from the origin Linux amd64 distribution. +# +# Usage: bootstrap.sh +# +# Needed environment variables: +# FETCH - Remote file fetcher and checksum verifier (injected by image) +# ROOT_DIST - 64 bit Linux Go binary distribution package +# ROOT_DIST_SHA1 - 64 bit Linux Go distribution package checksum +set -e + +# Download, verify and install the root distribution +$FETCH $ROOT_DIST $ROOT_DIST_SHA1 + +tar -C /usr/local -xzf `basename $ROOT_DIST` +rm -f `basename $ROOT_DIST` + +export GOROOT=/usr/local/go +export GOROOT_BOOTSTRAP=$GOROOT + +# Pre-build all guest distributions based on the root distribution +echo "Bootstrapping linux/386..." +GOOS=linux GOARCH=386 CGO_ENABLED=1 go install std + +echo "Bootstrapping linux/arm..." +GOOS=linux GOARCH=arm CGO_ENABLED=1 CC=arm-linux-gnueabi-gcc go install std + +echo "Bootstrapping windows/amd64..." +GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go install std + +echo "Bootstrapping windows/386..." +GOOS=windows GOARCH=386 CGO_ENABLED=1 CC=i686-w64-mingw32-gcc go install std + +echo "Bootstrapping darwin/amd64..." +GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 CC=o64-clang go install std + +echo "Bootstrapping darwin/386..." +GOOS=darwin GOARCH=386 CGO_ENABLED=1 CC=o32-clang go install std diff --git a/docker/xgo-image/base/build.sh b/docker/xgo-image/base/build.sh index c6f7f03..24e75cd 100644 --- a/docker/xgo-image/base/build.sh +++ b/docker/xgo-image/base/build.sh @@ -103,7 +103,7 @@ CC=i686-w64-mingw32-gcc GOOS=windows GOARCH=386 CGO_ENABLED=1 go build $V -o $NA echo "Compiling for darwin/amd64..." CC=o64-clang HOST=x86_64-apple-darwin10 PREFIX=/usr/local $BUILD_DEPS /deps CC=o64-clang GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go get -d ./$PACK -CC=o64-clang GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build $V $R -o $NAME-darwin-amd64$R ./$PACK +CC=o64-clang GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build -ldflags=-s $V $R -o $NAME-darwin-amd64$R ./$PACK #echo "Compiling for darwin/386..." #CC=o32-clang HOST=i386-apple-darwin10 PREFIX=/usr/local $BUILD_DEPS /deps diff --git a/docker/xgo-image/beats-builder/Dockerfile b/docker/xgo-image/beats-builder/Dockerfile index 9e84b6f..9146f77 100644 --- a/docker/xgo-image/beats-builder/Dockerfile +++ b/docker/xgo-image/beats-builder/Dockerfile @@ -1,4 +1,4 @@ -FROM tudorg/xgo-1.4.2 +FROM tudorg/xgo-1.5.1 MAINTAINER Tudor Golubenco diff --git a/docker/xgo-image/build.sh b/docker/xgo-image/build.sh index aaf9d90..92d86c7 100755 --- a/docker/xgo-image/build.sh +++ b/docker/xgo-image/build.sh @@ -1,5 +1,5 @@ #!/bin/sh docker build --rm=true -t tudorg/xgo-base base/ && \ - docker build --rm=true -t tudorg/xgo-1.4.2 go-1.4.2/ && + docker build --rm=true -t tudorg/xgo-1.5.1 go-1.5.1/ && docker build --rm=true -t tudorg/beats-builder beats-builder diff --git a/docker/xgo-image/go-1.4.2/Dockerfile b/docker/xgo-image/go-1.4.2/Dockerfile deleted file mode 100644 index 7083339..0000000 --- a/docker/xgo-image/go-1.4.2/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -# Go cross compiler (xgo): Go 1.4.2 layer -# Copyright (c) 2014 Péter Szilágyi. All rights reserved. -# -# Released under the MIT license. - -FROM tudorg/xgo-base - -MAINTAINER Tudor Golubenco - -# Configure the Go packages and bootstrap them -RUN \ - export DIST_LINUX_64=https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz && \ - export DIST_LINUX_64_SHA1=5020af94b52b65cc9b6f11d50a67e4bae07b0aff && \ - \ - export DIST_LINUX_32=https://storage.googleapis.com/golang/go1.4.2.linux-386.tar.gz && \ - export DIST_LINUX_32_SHA1=50557248e89b6e38d395fda93b2f96b2b860a26a && \ - \ - export DIST_LINUX_ARM=http://dave.cheney.net/paste/go1.4.2.linux-arm~armv5-1.tar.gz && \ - export DIST_LINUX_ARM_SHA1=1bcfc8ef9c2aa381722b71b8c8d83cb58e973116 && \ - \ - export DIST_OSX_64=https://storage.googleapis.com/golang/go1.4.2.darwin-amd64-osx10.6.tar.gz && \ - export DIST_OSX_64_SHA1=00c3f9a03daff818b2132ac31d57f054925c60e7 && \ - \ - export DIST_OSX_32=https://storage.googleapis.com/golang/go1.4.2.darwin-386-osx10.6.tar.gz && \ - export DIST_OSX_32_SHA1=fb3e6b30f4e1b1be47bbb98d79dd53da8dec24ec && \ - \ - export DIST_WIN_64=https://storage.googleapis.com/golang/go1.4.2.windows-amd64.zip && \ - export DIST_WIN_64_SHA1=91b229a3ff0a1ce6e791c832b0b4670bfc5457b5 && \ - \ - export DIST_WIN_32=https://storage.googleapis.com/golang/go1.4.2.windows-386.zip && \ - export DIST_WIN_32_SHA1=0e074e66a7816561d7947ff5c3514be96f347dc4 && \ - \ - $BOOTSTRAP diff --git a/docker/xgo-image/go-1.5.1/Dockerfile b/docker/xgo-image/go-1.5.1/Dockerfile new file mode 100644 index 0000000..a56609b --- /dev/null +++ b/docker/xgo-image/go-1.5.1/Dockerfile @@ -0,0 +1,15 @@ +# Go cross compiler (xgo): Go 1.5.1 layer +# Copyright (c) 2014 Péter Szilágyi. All rights reserved. +# +# Released under the MIT license. + +FROM tudorg/xgo-base + +MAINTAINER Tudor Golubenco + +# Configure the root Go distribution and bootstrap based on it +RUN \ + export ROOT_DIST=https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz && \ + export ROOT_DIST_SHA1=46eecd290d8803887dec718c691cc243f2175fe0 && \ + \ + $BOOTSTRAP_PURE