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-12-18 16:51:49 +01:00
|
|
|
ENV TERRAFORM_VERSION v0.11.11
|
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" ]
|