Skip to content

Commit

Permalink
chore(docker): added tfenv so users can control the terraform version
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielChalk committed Mar 18, 2021
1 parent fb2fc22 commit 5148394
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ WORKDIR $DEST_DIR
RUN apk update && apk add git openssh
RUN go build -o /usr/bin/twrapper ./cmd/twrapper

FROM golang:1.16.1-alpine AS tfenv
ARG DEST_DIR="/go/src/tfenv"
ARG TFENV_VERSION="v2.2.0"
RUN apk update && apk add git openssh && \
git clone https://github.com/tfutils/tfenv.git ${DEST_DIR}
WORKDIR $DEST_DIR
RUN git checkout tags/${TFENV_VERSION} -b ${TFENV_VERSION}

FROM alpine:3
COPY --from=build /usr/bin/twrapper /bin/twrapper
COPY --from=tfenv /go/src/tfenv /opt/tfenv
RUN apk update && apk add bash curl && \
ln -s /opt/tfenv/bin/terraform /usr/bin && \
ln -s /opt/tfenv/bin/tfenv /usr/bin
ENTRYPOINT [ "/bin/twrapper" ]

0 comments on commit 5148394

Please sign in to comment.