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 \
|
2019-05-25 23:23:46 +02:00
|
|
|
gcc \
|
2018-07-06 17:09:04 +02:00
|
|
|
git \
|
|
|
|
make \
|
2019-05-25 23:23:46 +02:00
|
|
|
musl-dev \
|
2018-07-06 17:09:04 +02:00
|
|
|
zip
|
2017-11-29 22:21:20 +01:00
|
|
|
|
2019-05-25 22:41:50 +02:00
|
|
|
ENV TERRAFORM_VERSION v0.12.0
|
2017-11-29 22:21:20 +01:00
|
|
|
|
2018-11-14 15:24:22 +01:00
|
|
|
RUN go get github.com/hashicorp/terraform || true
|
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}"
|
|
|
|
|
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" ]
|