Skip to content

fix: improve build reliability with fallback apt mirrors #18155

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

Merged
merged 2 commits into from
Jun 2, 2025

Conversation

bpmct
Copy link
Member

@bpmct bpmct commented Jun 1, 2025

Summary

  • Fixes image build failure by adding fallback to kernel.org mirrors when Ubuntu/Debian repositories fail
  • Ensures unzip is available during Bun installation process
  • Improves apt repository configuration to prevent 403 errors in CI

Root Cause

The build was failing for two reasons:

  1. Network issues with Ubuntu/Debian package repositories returning 403 Forbidden errors
  2. Unzip package not being reliably available in the image layer where Bun installation happens

Fix

  • Added fallback mirrors for apt repositories using kernel.org mirrors
  • Explicitly installed unzip before using it in the Bun installation
  • Added proper cleanup after package installations to keep image size down

Test plan

  • The CI workflow that was previously failing should now succeed
  • Build the dogfood image locally with cd dogfood/coder && docker build -t codercom/oss-dogfood:test .
  • Verify Bun is correctly installed and can be used

Fixes build failure from PR #18154 (original PR that added Bun)

🤖 Generated with Claude Code

This fix explicitly installs unzip in the same command chain where it's used for
the Bun installation process. Even though unzip is installed earlier in the
Dockerfile, this ensures it's available at the exact point it's needed,
avoiding potential issues in CI build environments like Depot.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Adds fallback to kernel.org mirrors when Ubuntu/Debian repositories fail
- Ensures unzip is available for Bun installation process
- Improves apt repository configuration to prevent 403 errors

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bpmct bpmct changed the title fix: ensure unzip is available for Bun installation fix: improve build reliability with fallback apt mirrors Jun 1, 2025
@bpmct bpmct marked this pull request as ready for review June 1, 2025 23:36
@bpmct bpmct merged commit 1e407fb into main Jun 2, 2025
36 checks passed
@bpmct bpmct deleted the fix-bun-installation branch June 2, 2025 00:01
@github-actions github-actions bot locked and limited conversation to collaborators Jun 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants