mirror of
https://github.com/Homebrew/brew.git
synced 2026-08-12 22:29:27 +04:00
Dockerfile: fail after all retry attempts fail
This commit is contained in:
+3
-2
@@ -18,9 +18,10 @@ RUN touch /var/mail/ubuntu && chown ubuntu /var/mail/ubuntu && userdel -r ubuntu
|
||||
# /etc/lsb-release is checked inside the container and sets DISTRIB_RELEASE.
|
||||
# We need `[` instead of `[[` because the shell is `/bin/sh`.
|
||||
# shellcheck disable=SC1091,SC2154,SC2292
|
||||
RUN bash -c "for i in {1..5}; do apt-get update && break || sleep \$((i)); done" \
|
||||
RUN retry() { bash -c 'for i in {1..5}; do "$@" && exit 0; [[ $((i)) -lt 5 ]] && sleep $((i)); done; exit 1' -- "$@"; } \
|
||||
&& retry apt-get update \
|
||||
&& apt-get install -y --no-install-recommends software-properties-common gnupg-agent \
|
||||
&& if [ "$(uname -m)" != aarch64 ]; then bash -c "for i in {1..5}; do add-apt-repository -y ppa:git-core/ppa && break || sleep \$((i)); done"; fi \
|
||||
&& if [ "$(uname -m)" != aarch64 ]; then retry add-apt-repository -y ppa:git-core/ppa; fi \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
acl \
|
||||
|
||||
Reference in New Issue
Block a user