Skip to content

Commit e9ab41c

Browse files
committed
feat: Improve container size
1 parent cb111fe commit e9ab41c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@ FROM python:3.11-alpine
33
ENV TFENV_VERSION v3.0.0
44
ENV TGENV_VERSION v0.0.3
55
ENV TFLINT_VERSION v0.44.1
6+
ENV TFSWITCH_VERSION 0.13.1300
67
ENV AZURE_CLI_VERSION 2.43.0
78

8-
RUN apk add --no-cache curl bash unzip git openssh-client jq \
9-
gcc musl-dev python3-dev libffi-dev openssl-dev cargo make && \
9+
RUN apk add --no-cache curl bash git openssh-client jq && \
10+
apk add --no-cache --virtual builddeps unzip gcc musl-dev python3-dev libffi-dev openssl-dev cargo make && \
1011
pip install --upgrade pip && pip install azure-cli==${AZURE_CLI_VERSION} && \
1112
curl --fail --silent -L -o /tmp/tfenv.zip https://github.com/tfutils/tfenv/archive/refs/tags/${TFENV_VERSION}.zip && \
1213
curl --fail --silent -L -o /tmp/tgenv.zip https://github.com/cunymatthieu/tgenv/archive/refs/tags/${TGENV_VERSION}.zip && \
1314
curl --fail --silent -L -o /tmp/tflint.zip https://github.com/terraform-linters/tflint/releases/download/${TFLINT_VERSION}/tflint_linux_amd64.zip && \
15+
curl --fail --silent -L -o /tmp/tfswitch-install.sh https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh && \
16+
chmod +x /tmp/tfswitch-install.sh && /tmp/tfswitch-install.sh -b /usr/local/bin "${TFSWITCH_VERSION}" && \
1417
unzip -u /tmp/tfenv -d /tmp && mv /tmp/tfenv-* ~/.tfenv/ && \
1518
unzip -u /tmp/tgenv -d /tmp && mv /tmp/tgenv-* ~/.tgenv/ && \
1619
unzip -u /tmp/tflint -d /usr/local/bin && \
1720
ln -s ~/.tfenv/bin/* /usr/local/bin && \
1821
ln -s ~/.tgenv/bin/* /usr/local/bin && \
19-
rm -f /tmp/*.zip && tfenv --version && tgenv --version && tflint --version && az --version && \
22+
rm -rf /tmp && apk del builddeps && \
23+
tfenv --version && tgenv --version && tflint --version && az --version && tfswitch --version && \
2024
adduser -g "iac-executor" -D iac-executor
2125

2226
USER iac-executor

0 commit comments

Comments
 (0)