dockerfiles/terraform/Dockerfile
Jess Frazelle e3b110208d update versions
Signed-off-by: Jess Frazelle <acidburn@jessfraz.com>
2019-05-25 16:41:50 -04:00

36 lines
712 B
Docker

FROM golang:alpine as builder
MAINTAINER Jessica Frazelle <jess@linux.com>
ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go
RUN apk add --no-cache \
bash \
ca-certificates \
git \
make \
zip
ENV TERRAFORM_VERSION v0.12.0
RUN go get github.com/hashicorp/terraform || true
WORKDIR /go/src/github.com/hashicorp/terraform
RUN git checkout "${TERRAFORM_VERSION}"
RUN XC_ARCH="amd64" XC_OS="linux" LD_FLAGS=" -extldflags -static" make fmt bin \
&& mv bin/terraform /usr/bin/terraform
FROM alpine:latest
RUN apk add --no-cache \
bash \
tar
COPY --from=builder /usr/bin/terraform /usr/bin/terraform
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
ENTRYPOINT [ "terraform" ]
CMD [ "--help" ]