Skip to content

Commit 8f6bb64

Browse files
committed
Workaround "Could not connect to azure.archive.ubuntu.com:80"
1 parent 80608fc commit 8f6bb64

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,18 @@ jobs:
4747
restore-keys: |
4848
${{ runner.os }}-trivy-
4949
50+
- name: Configure APT
51+
run: |
52+
# Workaround to avoid sporadic connectivity issues "Could not connect to azure.archive.ubuntu.com:80"
53+
# see https://github.com/actions/virtual-environments/issues/675
54+
echo 'APT::Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-acquire-retries
55+
if ! curl --max-time 3 --output /dev/null --silent --head --fail "http://azure.archive.ubuntu.com/ubuntu/dists/"; then
56+
sudo sed -i 's/azure\.//' /etc/apt/sources.list
57+
sudo apt-get update
58+
fi
59+
5060
- name: Install dos2unix
51-
# using '-o Acquire::Retries=3' to workaround sporadic connectivity issues "Could not connect to azure.archive.ubuntu.com:80"
52-
# see https://github.com/actions/virtual-environments/issues/675
53-
run: sudo apt-get install -o Acquire::Retries=3 --no-install-recommends -y dos2unix
61+
run: sudo apt-get install --no-install-recommends -y dos2unix
5462

5563
- name: Build docker image
5664
shell: bash

0 commit comments

Comments
 (0)