Skip to content

docker(install): retry macOS archive installs on transient apt mirror failures#1090

Merged
crazy-max merged 1 commit intodocker:mainfrom
crazy-max:docker-install-retry
Apr 17, 2026
Merged

docker(install): retry macOS archive installs on transient apt mirror failures#1090
crazy-max merged 1 commit intodocker:mainfrom
crazy-max:docker-install-retry

Conversation

@crazy-max
Copy link
Copy Markdown
Member

relates to https://github.com/docker/actions-toolkit/actions/runs/24534040516/job/71724508344#step:10:1656

Archive install script log
  + curl -fsSL https://get.docker.com/
  + sh -s -- --channel stable --version 29.4.0
  # Executing docker install script, commit: 8fb5881103ac6f2fb404605d6d5b1f84244f3896
  + sh -c apt-get -qq update >/dev/null
  E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/noble-security/universe/binary-amd64/Packages.xz  File has unexpected size (1168996 != 1169356). Mirror sync in progress? [IP: 91.189.91.81 80]
     Hashes of expected file:
      - Filesize:1169356 [weak]
      - SHA256:4e51e49a33aa3620d62a5baa71ebafa3b842126e00f7c127ec0c135dae3ace13
      - SHA1:2426cb1dad6e771311e91b7cf9399f7591e9453e [weak]
      - MD5Sum:0ff540ebd6e0012a67a9c919230dd2c6 [weak]
     Release file created at: Thu, 16 Apr 2026 19:40:19 +0000
  E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/noble-security/universe/i18n/Translation-en.xz  
  E: Some index files failed to download. They have been ignored, or old ones used instead.
  time="2026-04-16T21:25:14Z" level=warning msg="provisioning scripts should not reference the LIMA_CIDATA variables"

Comment thread src/docker/assets.ts Outdated
max_attempts=3
until [ "$attempt" -gt "$max_attempts" ]; do
echo "Docker install attempt $attempt/$max_attempts"
if curl -fsSL https://get.docker.com | sh -s -- --channel {{srcArchiveChannel}} --version {{srcArchiveVersion}}; then
Copy link
Copy Markdown

@tcely tcely Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it make sense to store the curl output and possibly use the --retry 5 option before the loop?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to have curl --retry as an extra guard, but the failure here was inside get.docker.com during apt-get update, after curl had already succeeded.

@crazy-max crazy-max force-pushed the docker-install-retry branch from 8039559 to b54f595 Compare April 16, 2026 21:54
Copy link
Copy Markdown

@tcely tcely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than a hard-coded file in /tmp using mktemp is safer.

The execute permission is unnecessary because we are invoking sh not the script file.

Comment thread src/docker/assets.ts Outdated
Comment thread src/docker/assets.ts Outdated
Comment thread src/docker/assets.ts Outdated
@crazy-max
Copy link
Copy Markdown
Member Author

Good catch makes sense thx

@crazy-max crazy-max force-pushed the docker-install-retry branch from b54f595 to a277844 Compare April 16, 2026 22:13
Comment thread src/docker/assets.ts Outdated
Comment thread src/docker/assets.ts Outdated
Comment thread src/docker/assets.ts Outdated
@crazy-max crazy-max force-pushed the docker-install-retry branch from a277844 to 7f1a6e0 Compare April 16, 2026 22:30
… failures

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max force-pushed the docker-install-retry branch from 7f1a6e0 to c3d1cd7 Compare April 16, 2026 22:31
@crazy-max crazy-max marked this pull request as ready for review April 17, 2026 08:17
@crazy-max crazy-max merged commit c0802dd into docker:main Apr 17, 2026
116 checks passed
@crazy-max crazy-max deleted the docker-install-retry branch April 17, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants