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-11-04 02:33:50 +01:00
|
|
|
ENV TERRAFORM_VERSION v0.11.10
|
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/...
|
|
|
|
|
2018-09-05 18:48:06 +02:00
|
|
|
RUN XC_ARCH="amd64" XC_OS="linux" LD_FLAGS=" -extldflags -static" make fmt bin \
|
2018-07-06 17:09:04 +02:00
|
|
|
&& mv bin/terraform /usr/bin/terraform
|
|
|
|
|
2018-07-06 17:11:06 +02:00
|
|
|
FROM alpine:latest
|
2018-07-06 17:09:04 +02:00
|
|
|
|
2018-07-14 03:59:37 +02:00
|
|
|
RUN apk add --no-cache \
|
|
|
|
bash \
|
|
|
|
tar
|
|
|
|
|
2018-07-06 17:09:04 +02:00
|
|
|
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" ]
|