From 065a48a71730826465aa9a4a91a49fbff939290b Mon Sep 17 00:00:00 2001 From: Sid Carter Date: Wed, 29 Nov 2017 16:21:20 -0500 Subject: [PATCH] add new dockerfile for terraform (#312) --- terraform/Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 terraform/Dockerfile diff --git a/terraform/Dockerfile b/terraform/Dockerfile new file mode 100644 index 0000000..3c77398 --- /dev/null +++ b/terraform/Dockerfile @@ -0,0 +1,37 @@ +FROM alpine:3.6 +LABEL maintainer "Sid Carter " + +ENV PATH /go/bin:/usr/local/go/bin:$PATH +ENV GOPATH /go + +RUN apk --no-cache add \ + ca-certificates + +ENV TERRAFORM_VERSION v0.11.0 + +RUN buildDeps=' \ + bash \ + go \ + git \ + gcc \ + g++ \ + libc-dev \ + libgcc \ + make \ + zip \ + ' \ + set -x \ + && apk --no-cache add --repository https://dl-3.alpinelinux.org/alpine/edge/community $buildDeps \ + && go get github.com/Soulou/curl-unix-socket \ + && mv /go/bin/curl-unix-socket /usr/bin/ \ + && mkdir -p /go/src/github.com/hashicorp /etc/terraform.d \ + && git clone --depth 1 --branch ${TERRAFORM_VERSION} https://github.com/hashicorp/terraform /go/src/github.com/hashicorp/terraform \ + && cd /go/src/github.com/hashicorp/terraform \ + && XC_ARCH="amd64" XC_OS="linux" make bin \ + && mv pkg/linux_amd64/terraform /usr/bin/ \ + && apk del $buildDeps \ + && rm -rf /go \ + && echo "Build complete." + + +ENTRYPOINT [ "terraform" ]