Last active
May 15, 2018 15:30
-
-
Save miked0004/d459405f954b7887146a5072a6979cdc to your computer and use it in GitHub Desktop.
demo using docker to compile terraform master branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# this will cross-compile terraform from source and drop the zipped | |
# packages in ./build | |
# | |
# this is only an exercise for docker, it is not a recommended usage | |
# of anything | |
# | |
mkdir -p ./build | |
cat<<-EOF | docker build --rm -t my/gobuilder - | |
FROM golang | |
RUN set -x \ | |
&& apt-get update \ | |
&& apt-get install -y zip unzip \ | |
&& apt-get clean | |
RUN set -x \ | |
&& go get github.com/hashicorp/terraform | |
EOF | |
docker run --rm -it -v "$(pwd)":/host my/gobuilder /bin/bash -cx ' | |
cd /go/src/github.com/hashicorp/terraform && | |
git pull && | |
XC_OS="linux darwin" XC_ARCH="amd64" make bin && | |
cp /go/src/github.com/hashicorp/terraform/pkg/*.zip /host/build' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment