-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-alpine
34 lines (25 loc) · 1.19 KB
/
Dockerfile-alpine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
ARG ATLANTIS_VERSION
ARG PYTHON_ALPINE_VERSION=3.10.8-alpine3.16
# Build AWS CLI
FROM python:${PYTHON_ALPINE_VERSION} as builder
ARG AWS_CLI_VERSION=2.11.19
RUN apk add --no-cache git unzip groff build-base libffi-dev cmake
RUN git clone --single-branch --depth 1 -b ${AWS_CLI_VERSION} https://github.com/aws/aws-cli.git
WORKDIR aws-cli
RUN python -m venv venv
RUN . venv/bin/activate
RUN scripts/installers/make-exe
RUN unzip -q dist/awscli-exe.zip
RUN aws/install --bin-dir /aws-cli-bin
RUN /aws-cli-bin/aws --version
# 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
RUN find /usr/local/aws-cli/v2/current/dist/awscli/botocore/data -name examples-1.json -delete
# Build the final image
FROM ghcr.io/runatlantis/atlantis:${ATLANTIS_VERSION}
# Install built AWS CLI
COPY --from=builder /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=builder /aws-cli-bin/ /usr/local/bin/
# Install Infracost
ARG INFRACOST_VERSION=v0.10.22
RUN curl -fsSL https://raw.githubusercontent.com/infracost/infracost/$INFRACOST_VERSION/scripts/install.sh | sh