Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move from aws cli v1 to aws cli v2 #19

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
FROM alpine:3.14.0
FROM python:3.9-alpine3.14 as aws-cli-builder

RUN apk add --no-cache git \
unzip \
groff \
build-base \
libffi-dev \
cmake

ENV AWS_CLI_VERSION=2.7.25

RUN mkdir /aws && \
git clone --single-branch --depth 1 -b ${AWS_CLI_VERSION} https://github.com/aws/aws-cli.git /aws && \
cd /aws && \
sed -i'' 's/PyInstaller.*/PyInstaller==5.2/g' requirements-build.txt && \
python -m venv venv && \
. venv/bin/activate && \
./scripts/installers/make-exe

RUN unzip /aws/dist/awscli-exe.zip && \
./aws/install --bin-dir /aws-cli-bin && \
/aws-cli-bin/aws --version

FROM alpine:3.14.8 as runner

RUN apk -U upgrade && apk add --no-cache \
aws-cli \
bash \
ca-certificates \
curl \
git \
jq \
openssh \
openssh-keygen \
tzdata
tzdata \
groff # for aws-cli

# AWS CLI
COPY --from=aws-cli-builder /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=aws-cli-builder /aws-cli-bin/ /usr/local/bin/

# Download infracost
RUN curl -s -L https://github.com/infracost/infracost/releases/latest/download/infracost-linux-amd64.tar.gz | \
Expand Down