From d560c82e451bac2ea3f7b57f4cc9ee0c751f4473 Mon Sep 17 00:00:00 2001 From: Chuck Budzeak Date: Wed, 13 Oct 2021 13:27:13 -0400 Subject: [PATCH 1/2] add awscli to image --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 1e37082..f2f90c9 100755 --- a/build.sh +++ b/build.sh @@ -5,7 +5,8 @@ set -ex apt-get update apt-get -qq -y install --no-install-recommends \ ca-certificates curl tar git \ - libyaml-dev build-essential jq uuid-runtime + libyaml-dev build-essential jq uuid-runtime \ + awscli # Install our user and create directory to install actions-runner and the hostedtoolcache addgroup --gid 1000 "${RUNGROUP}" && adduser --uid 1000 --ingroup "${RUNGROUP}" --shell /bin/bash "${RUNUSER}" From 198c1d168e5f78ca690357781988cf0f1f4d6c6a Mon Sep 17 00:00:00 2001 From: Chuck Budzeak Date: Wed, 13 Oct 2021 17:28:17 -0400 Subject: [PATCH 2/2] add unzip and fetch, install, and cleanup for awscliv2 and actions-runner archives --- build.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index f2f90c9..a885077 100755 --- a/build.sh +++ b/build.sh @@ -6,7 +6,7 @@ apt-get update apt-get -qq -y install --no-install-recommends \ ca-certificates curl tar git \ libyaml-dev build-essential jq uuid-runtime \ - awscli + unzip # Install our user and create directory to install actions-runner and the hostedtoolcache addgroup --gid 1000 "${RUNGROUP}" && adduser --uid 1000 --ingroup "${RUNGROUP}" --shell /bin/bash "${RUNUSER}" @@ -25,6 +25,20 @@ tar xzf "./actions-runner-linux-x64-${ACTIONS_VERSION}.tar.gz" # Install .Net Core 3.x Linux Dependencies ./bin/installdependencies.sh +# Install awscliv2 +curl -sL https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip +unzip awscliv2.zip +./aws/install + +# Cleanup archive debris and unnecessary items to reduce image size +rm -rf \ + awscliv2.zip \ + aws \ + /usr/local/aws-cli/v2/*/dist/aws_completer \ + /usr/local/aws-cli/v2/*/dist/awscli/data/ac.index \ + /usr/local/aws-cli/v2/*/dist/awscli/examples \ + "actions-runner-linux-x64-${ACTIONS_VERSION}.tar.gz" + # give privileges to our user chown -R "${RUNUSER}":"${RUNGROUP}" "/opt/hostedtoolcache" chown -R "${RUNUSER}":"${RUNGROUP}" "/home/${RUNUSER}" \ No newline at end of file