Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rkfella authored Jan 31, 2025
1 parent 517d5b1 commit 5c820d9
Showing 1 changed file with 3 additions and 35 deletions.
38 changes: 3 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,43 +1,11 @@
FROM python:3.11-alpine3.21 AS builder

ARG AWS_CLI_VERSION=2.22.35

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

RUN mkdir /aws && \
git clone --single-branch --depth 1 -b ${AWS_CLI_VERSION} https://github.com/aws/aws-cli.git /aws && \
cd /aws && \
python -m venv venv && \
. venv/bin/activate && \
pip install --upgrade pip setuptools && \
./scripts/installers/make-exe

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

# Reduce image size: remove autocomplete and examples
RUN rm -rf \
/usr/local/aws-cli/v2/current/dist/aws_completer \
/usr/local/aws-cli/v2/current/dist/awscli/data/ac.index \
/usr/local/aws-cli/v2/current/dist/awscli/examples && \
find /usr/local/aws-cli/v2/current/dist/awscli/data -name completions-1*.json -delete && \
find /usr/local/aws-cli/v2/current/dist/awscli/botocore/data -name examples-1.json -delete


FROM alpine:3.21

USER root

COPY --from=hashicorp/vault:1.18 /bin/vault /usr/local/bin/vault
RUN vault --version

COPY --from=builder /usr/local/aws-cli /usr/local/aws-cli
COPY --from=builder /aws-cli-bin/ /usr/local/bin/
COPY --from=ghcr.io/d4rkfella/aws-cli-alpine:2.22.35 /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=ghcr.io/d4rkfella/aws-cli-alpine:2.22.35 /aws-cli-bin/ /usr/local/bin/

RUN aws --version

RUN apk update && apk add --no-cache \
Expand Down

0 comments on commit 5c820d9

Please sign in to comment.