Skip to content

feat: replace custom auto-install shim with mise for on-demand tools#6

Merged
gabemeola merged 24 commits into
mainfrom
feature/brew-auto-install
Jun 27, 2026
Merged

feat: replace custom auto-install shim with mise for on-demand tools#6
gabemeola merged 24 commits into
mainfrom
feature/brew-auto-install

Conversation

@gabemeola

Copy link
Copy Markdown
Member
  • Add mise config (mise-config.toml) with pre-approved tools via brew backend
  • Install mise in builder stage, pre-install tools, copy to final
  • Set MISE_DATA_DIR=/opt/mise (outside home, not shadowed by volume)
  • Enable always_install setting for auto-install on first use
  • Add mise activation to .bashrc
  • Remove old brew-auto-install.conf and brew-install-handler.sh
  • Remove gh from apt install (now managed by mise via brew)

- Add mise config (mise-config.toml) with pre-approved tools via brew backend
- Install mise in builder stage, pre-install tools, copy to final
- Set MISE_DATA_DIR=/opt/mise (outside home, not shadowed by volume)
- Enable always_install setting for auto-install on first use
- Add mise activation to .bashrc
- Remove old brew-auto-install.conf and brew-install-handler.sh
- Remove gh from apt install (now managed by mise via brew)
…rew as opencode user

- MISE_INSTALL_PATH (not MISE_INSTALL_DIR) is the correct env var
- Pre-install gh/glab via sudo -u opencode brew instead of mise install
  (builder runs as root, brew is owned by opencode)
- Remove mise settings set; use MISE_ALWAYS_INSTALL=1 env var instead
- Add HOMEBREW_NO_AUTO_UPDATE=1 to brew install in builder
- HOMEBREW_INSTALL_FROM_API=1 lets brew install any formula via JSON API
  without needing a local tap, so we can strip the entire homebrew-core
  (saves ~20MB)
- brew install at runtime works for any formula, including ones added
  to homebrew-core after the image was built
- No git operations needed, so .git removal is no longer relevant
- Keep homebrew-core with .git intact (brew update requires it)
- Remove HOMEBREW_INSTALL_FROM_API=1 (no longer needed with local tap)
- Keep other size optimizations (test, cask, portable-ruby, gem cache)
With HOMEBREW_INSTALL_FROM_API=1:
- brew update downloads API JSON (fast, no git needed)
- brew install fetches formula metadata from API cache
- brew install works for any formula immediately
- Homebrew-core tap can be stripped entirely (saves ~100MB)

This is actually better than keeping the local tap.
… mise

- Remove ruby, wget, jq, ripgrep, fd-find, vim-tiny, nano from apt
- Keep portable-ruby (brew needs it with system ruby removed)
- Move brew install gh glab before stripping homebrew-core tap
- Add all moved tools to mise-config.toml
- Update README tables and notes
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Docker image size comparison

Image Size
Baseline (main) 1.21GB
This PR 951MB
Difference 248MB

@gabemeola gabemeola merged commit 7b58338 into main Jun 27, 2026
1 check passed
@gabemeola gabemeola deleted the feature/brew-auto-install branch June 27, 2026 16:34
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.

1 participant