-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
22 lines (20 loc) · 747 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM golang:1.20.0-alpine AS build
ARG DEST_DIR="/go/src/twrapper"
COPY . $DEST_DIR
WORKDIR $DEST_DIR
RUN apk update && apk add git openssh
RUN go build -o /usr/bin/twrapper ./cmd/twrapper
FROM golang:1.20.0-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:/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 git jq openssh && \
ln -s /opt/tfenv/bin/terraform /usr/bin && \
ln -s /opt/tfenv/bin/tfenv /usr/bin
ENTRYPOINT [ "/bin/twrapper" ]