Browse the docs

Project

Building the macOS images

The images are built on an Apple silicon Mac running macOS 27 or later. A VM can't run another macOS VM, so cloud CI runners can't build them.

hangar image build vanilla --push ghcr.io/baseguard/hangar-macos
hangar image build base --push ghcr.io/baseguard/hangar-macos
hangar image build xcode --xcode /Applications/Xcode.app --push ghcr.io/baseguard/hangar-macos

Each push tags the image twice, for example base-27.0.1 and base; Hangar uses the short tag. Pushing signs in with hangar login.

How they fit together

  • vanilla is the latest macOS installed and never started.
  • base is a copy of it with the account admin.
  • xcode is a copy of base with Xcode.

So most of their parts are the same.

The first start

For base and xcode, sudo hangar image prepare writes a one-time job into the copy's disk. It runs Hangar's own binary as root, so use a build you trust (macOS protects a notarized Hangar in /Applications from being changed by other apps).

On the first start the job installs what's missing: the Command Line Tools, Homebrew (as admin, with a sudo rule removed right after), Xcode, and Hangar's agent, then deletes itself.

hangar image verify checks that nothing is left over before the disk is pushed.