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
|
|
|
|
2021-03-09 18:51:46 +01:00
|
|
|
ENV TERRAFORM_VERSION v0.14.7
|
2017-11-29 22:21:20 +01:00
|
|
|
|
2021-03-12 20:21:10 +01:00
|
|
|
RUN git clone --depth 1 --branch ${TERRAFORM_VERSION} https://github.com/hashicorp/terraform.git /go/src/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
|
|
|
|
|
2021-03-09 18:51:46 +01:00
|
|
|
RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-w -extldflags "-static"' \
|
|
|
|
-o bin/terraform && \
|
|
|
|
mv bin/terraform /usr/bin/terraform
|
2018-07-06 17:09:04 +02:00
|
|
|
|
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" ]
|