Skip to content

Commit

Permalink
Factor out duplicated install-docker shell script.
Browse files Browse the repository at this point in the history
  • Loading branch information
sengi committed May 18, 2024
1 parent fa292d9 commit 0278145
Showing 1 changed file with 16 additions and 36 deletions.
52 changes: 16 additions & 36 deletions .github/workflows/build-and-push-multiarch-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,21 @@ jobs:
id-token: write
contents: read
steps:
# TODO: remove this step once GitHub's ARM runner image comes with Docker.
- name: Install Docker (GitHub ARM Only)
if: matrix.runner == 'arm64-runner'
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends acl ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -a -G docker "$USER"
sudo setfacl --modify "user:$USER:rw" /var/run/docker.sock
- uses: actions/checkout@v4
with:
ref: ${{ inputs.gitRef }}
show-progress: false

- uses: actions/checkout@v4
with:
show-progress: false
sparse-checkout: .github/workflows/install-docker.sh

# TODO: remove this step once GitHub's ARM runner image comes with Docker.
- name: Install Docker (GitHub ARM Only)
if: matrix.runner == 'arm64-runner'
run: sudo .github/workflows/install-docker.sh

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand Down Expand Up @@ -138,25 +128,15 @@ jobs:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
with:
show-progress: false
sparse-checkout: .github/workflows/install-docker.sh

# TODO: remove this step once GitHub's ARM runner image comes with Docker.
- name: Install Docker (GitHub ARM Only)
if: matrix.runner == 'arm64-runner'
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends acl ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -a -G docker "$USER"
sudo setfacl --modify "user:$USER:rw" /var/run/docker.sock
run: sudo .github/workflows/install-docker.sh

- name: Download Digests
uses: actions/download-artifact@v4
Expand Down

0 comments on commit 0278145

Please sign in to comment.