2017-12-14 22:25:09 +01:00
|
|
|
FROM alpine:latest
|
2017-11-29 22:21:20 +01:00
|
|
|
LABEL maintainer "Sid Carter <me@sidcarter.com>"
|
|
|
|
|
|
|
|
ENV PATH /go/bin:/usr/local/go/bin:$PATH
|
|
|
|
ENV GOPATH /go
|
|
|
|
|
|
|
|
RUN apk --no-cache add \
|
|
|
|
ca-certificates
|
|
|
|
|
2018-02-03 23:03:35 +01:00
|
|
|
ENV TERRAFORM_VERSION v0.11.3
|
2017-11-29 22:21:20 +01:00
|
|
|
|
|
|
|
RUN buildDeps=' \
|
|
|
|
bash \
|
|
|
|
go \
|
|
|
|
git \
|
|
|
|
gcc \
|
|
|
|
g++ \
|
|
|
|
libc-dev \
|
|
|
|
libgcc \
|
|
|
|
make \
|
|
|
|
' \
|
|
|
|
set -x \
|
|
|
|
&& apk --no-cache add --repository https://dl-3.alpinelinux.org/alpine/edge/community $buildDeps \
|
|
|
|
&& 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 \
|
2018-01-02 19:04:34 +01:00
|
|
|
&& mv bin/terraform /usr/bin/terraform \
|
2017-11-29 22:21:20 +01:00
|
|
|
&& apk del $buildDeps \
|
|
|
|
&& rm -rf /go \
|
|
|
|
&& echo "Build complete."
|
|
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT [ "terraform" ]
|
2018-01-02 19:04:34 +01:00
|
|
|
CMD [ "--help" ]
|