2018-07-06 17:09:04 +02:00
|
|
|
FROM golang:alpine as builder
|
|
|
|
MAINTAINER Jessica Frazelle <jess@linux.com>
|
2017-11-29 22:21:20 +01:00
|
|
|
|
|
|
|
ENV PATH /go/bin:/usr/local/go/bin:$PATH
|
|
|
|
ENV GOPATH /go
|
|
|
|
|
2018-07-06 17:09:04 +02:00
|
|
|
RUN apk add --no-cache \
|
|
|
|
bash \
|
|
|
|
ca-certificates \
|
|
|
|
git \
|
|
|
|
make \
|
|
|
|
zip
|
2017-11-29 22:21:20 +01:00
|
|
|
|
2018-04-12 15:59:16 +02:00
|
|
|
ENV TERRAFORM_VERSION v0.11.7
|
2017-11-29 22:21:20 +01:00
|
|
|
|
2018-07-06 17:09:04 +02:00
|
|
|
RUN go get github.com/hashicorp/terraform
|
2017-11-29 22:21:20 +01:00
|
|
|
|
2018-07-06 17:09:04 +02:00
|
|
|
WORKDIR /go/src/github.com/hashicorp/terraform
|
|
|
|
|
|
|
|
RUN git checkout "${TERRAFORM_VERSION}"
|
|
|
|
|
|
|
|
# Install the vendor packages so stringer works.
|
|
|
|
# See: https://github.com/golang/go/issues/10249
|
|
|
|
RUN go install ./vendor/...
|
|
|
|
|
|
|
|
RUN XC_ARCH="amd64" XC_OS="linux" LD_FLAGS=" -extldflags -static" make bin \
|
|
|
|
&& mv bin/terraform /usr/bin/terraform
|
|
|
|
|
|
|
|
FROM scratch
|
|
|
|
|
|
|
|
COPY --from=builder /usr/bin/terraform /usr/bin/terraform
|
|
|
|
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
|
2017-11-29 22:21:20 +01:00
|
|
|
|
|
|
|
ENTRYPOINT [ "terraform" ]
|
2018-01-02 19:04:34 +01:00
|
|
|
CMD [ "--help" ]
|