Use pre-built base image in build-local.sh to speed up cold builds #51

Open
opened 2026-03-11 21:36:07 +00:00 by mik-tf · 0 comments
Owner

Problem

build-local.sh uses raw rust:1.93-bookworm as the build image. On cold builds (CI, fresh workspace), the WASM step spends ~5-6 min installing dioxus-cli, binaryen, and wasm target every time.

Solution

Use Dockerfile.base (already exists) as a pre-built base image with all tooling baked in:

  • Rust 1.93 + wasm32-unknown-unknown target
  • dioxus-cli (pre-compiled)
  • binaryen (apt)
  • ONNX Runtime libs

Update build-local.sh to use hero_zero:base instead of rust:1.93-bookworm.
Add make base target to build and push the base image.

Impact

  • Cold builds: ~5-6 min faster
  • Warm builds: ~30s faster (skip tool detection)
  • CI: ~5-6 min faster per run
  • Zero risk: inline installs still work as fallback if base is stale

Related: lhumina_code/home#17

## Problem `build-local.sh` uses raw `rust:1.93-bookworm` as the build image. On cold builds (CI, fresh workspace), the WASM step spends ~5-6 min installing dioxus-cli, binaryen, and wasm target every time. ## Solution Use `Dockerfile.base` (already exists) as a pre-built base image with all tooling baked in: - Rust 1.93 + wasm32-unknown-unknown target - dioxus-cli (pre-compiled) - binaryen (apt) - ONNX Runtime libs Update `build-local.sh` to use `hero_zero:base` instead of `rust:1.93-bookworm`. Add `make base` target to build and push the base image. ## Impact - Cold builds: ~5-6 min faster - Warm builds: ~30s faster (skip tool detection) - CI: ~5-6 min faster per run - Zero risk: inline installs still work as fallback if base is stale Related: https://forge.ourworld.tf/lhumina_code/home/issues/17
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_services#51
No description provided.