File tree Expand file tree Collapse file tree
app/src/lib/core/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 - name : Install OpenSSH client
2525 shell : bash
2626 run : |
27- sudo apt-get update
28- sudo apt-get install -y openssh-client
27+ for attempt in 1 2 3; do
28+ sudo rm -rf /var/lib/apt/lists/*
29+ if sudo apt-get -o Acquire::Retries=3 -o Acquire::By-Hash=force update; then
30+ break
31+ fi
32+ if [[ "$attempt" == "3" ]]; then
33+ echo "apt-get update failed after retries" >&2
34+ exit 1
35+ fi
36+ echo "apt-get update attempt ${attempt} failed; retrying..." >&2
37+ sleep $((attempt * 2))
38+ done
39+ sudo apt-get -o Acquire::Retries=3 install -y openssh-client
2940 - name : Install node-gyp
3041 shell : bash
3142 run : npm install -g node-gyp
Original file line number Diff line number Diff line change @@ -9,7 +9,22 @@ ENV BUN_INSTALL=/opt/bun
99ENV PATH=/opt/bun/bin:$PATH
1010WORKDIR /workspace
1111
12- RUN apt-get update && apt-get install -y --no-install-recommends \
12+ RUN set -eu; \
13+ sed -i 's|http://archive.ubuntu.com/ubuntu|http://azure.archive.ubuntu.com/ubuntu|g' \
14+ /etc/apt/sources.list /etc/apt/sources.list.d/ubuntu.sources 2>/dev/null || true; \
15+ for attempt in 1 2 3; do \
16+ rm -rf /var/lib/apt/lists/*; \
17+ if apt-get -o Acquire::Retries=3 -o Acquire::By-Hash=force update; then \
18+ break; \
19+ fi; \
20+ if [ "$attempt" = "3" ]; then \
21+ echo "apt-get update failed after retries" >&2; \
22+ exit 1; \
23+ fi; \
24+ echo "apt-get update attempt ${attempt} failed; retrying..." >&2; \
25+ sleep $((attempt * 2)); \
26+ done; \
27+ apt-get -o Acquire::Retries=3 install -y --no-install-recommends \
1328 ca-certificates curl git docker.io docker-compose-v2 openssh-client sshpass python3 make g++ unzip \
1429 && rm -rf /var/lib/apt/lists/*
1530
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ ENV NVM_DIR=/usr/local/nvm
1111RUN set -eu; \
1212 for attempt in 1 2 3 4 5; do \
1313 rm -rf /var/lib/apt/lists/*; \
14- if apt-get -o Acquire::Retries=3 update; then \
14+ if apt-get -o Acquire::Retries=3 -o Acquire::By-Hash=force update; then \
1515 break; \
1616 fi; \
1717 if [ "$attempt" = "5" ]; then \
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ ENV NVM_DIR=/usr/local/nvm
1010RUN set -eu; \
1111 for attempt in 1 2 3 4 5; do \
1212 rm -rf /var/lib/apt/lists/*; \
13- if apt-get -o Acquire::Retries=3 update; then \
13+ if apt-get -o Acquire::Retries=3 -o Acquire::By-Hash=force update; then \
1414 break; \
1515 fi; \
1616 if [ "$attempt" = "5" ]; then \
You can’t perform that action at this time.
0 commit comments