Skip to content

Commit

Permalink
AL: add awscli install script
Browse files Browse the repository at this point in the history
  • Loading branch information
adalundhe committed Feb 9, 2024
1 parent f619769 commit 2435252
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
6 changes: 3 additions & 3 deletions golang/Dockerfile.golang
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | g
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \
apt update && apt install -y gh unzip;

RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install
COPY resources/install_awscli.sh ./install_awscli.sh
RUN bash install_awscli.sh && \
rm -rf install_awscli.sh

RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
Expand Down
6 changes: 3 additions & 3 deletions node/Dockerfile.node
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | g
WORKDIR /app
RUN npm install -g --registry=${REGISTRY_URL} pnpm

RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install
COPY resources/install_awscli.sh ./install_awscli.sh
RUN bash install_awscli.sh && \
rm -rf install_awscli.sh

RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
Expand Down
10 changes: 5 additions & 5 deletions python/Dockerfile.python
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | g
RUN pip install --index-url ${INDEX_URL} \
poetry pytest playwright \
pytest-cov pydantic
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install

COPY resources/install_awscli.sh ./install_awscli.sh
RUN bash install_awscli.sh && \
rm -rf install_awscli.sh

RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
#
Expand Down
20 changes: 20 additions & 0 deletions resources/install_awscli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#! /usr/bin/env bash

set -e

apt upgrade && \
apt install -y coreutils

ARCH=$(arch)

if [[ "$ARCH" == "arm64" ]]; then
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install
else
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
sudo ./aws/install
fi

rm -rf awscliv2.zip

0 comments on commit 2435252

Please sign in to comment.