Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retry around apt-get install #2

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 31 additions & 16 deletions ubuntu-noble/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,38 @@ set -eufo pipefail

export DEBIAN_FRONTEND=noninteractive

# Install main packages
apt-get update
apt-get install -y --no-install-recommends \
apt-transport-https \
bash \
ca-certificates \
curl \
git \
gnupg-agent \
jq \
openssh-client \
perl \
python3 \
python3-pip \
rsync \
software-properties-common \
tini

# Install main packages
#
# There's a subtle flaky bug, somewhere in Linux or qemu, that happens when
# running in an emulated arm64 environment. When installing various python3
# dependencies (python3-six, python3-pip, etc), their maintainer scripts run
# py3compile, which sometimes has an exception getting python3 to run
# 'import sys; print(sys.implementation.cache_tag)'.
# Seen at: https://www.kicksecure.com/wiki/Dev/todo#ISO_-_ARM64_build_failing
# Weirdly, this isn't happening for the older Ubuntu LTSes, only Noble!
#
# It's a flake, so let's wrap `apt-get install` in a small retry.
#
install_main_pkgs() {
apt-get install -y --no-install-recommends \
apt-transport-https \
bash \
ca-certificates \
curl \
git \
gnupg-agent \
jq \
openssh-client \
perl \
python3 \
python3-pip \
rsync \
software-properties-common \
tini
}
(r=3; while ! install_main_pkgs; do ((--r)) || exit; done)

# Install Docker Engine
install -m 0755 -d /etc/apt/keyrings
Expand Down