|
| 1 | +# macOS setup guide |
| 2 | + |
| 3 | +This guide is for running `docker2vm` on macOS (Apple Silicon or Intel). |
| 4 | + |
| 5 | +## 1) Install required tools |
| 6 | + |
| 7 | +```bash |
| 8 | +brew install bun qemu e2fsprogs |
| 9 | +``` |
| 10 | + |
| 11 | +If you want Dockerfile conversion (`dockerfile2gondolin`), also install Docker Desktop. |
| 12 | + |
| 13 | +## 2) Ensure `mke2fs` and `debugfs` are on `PATH` |
| 14 | + |
| 15 | +`e2fsprogs` is often keg-only on macOS. |
| 16 | + |
| 17 | +### Apple Silicon (`/opt/homebrew`) |
| 18 | + |
| 19 | +```bash |
| 20 | +echo 'export PATH="/opt/homebrew/opt/e2fsprogs/sbin:$PATH"' >> ~/.zshrc |
| 21 | +source ~/.zshrc |
| 22 | +``` |
| 23 | + |
| 24 | +### Intel (`/usr/local`) |
| 25 | + |
| 26 | +```bash |
| 27 | +echo 'export PATH="/usr/local/opt/e2fsprogs/sbin:$PATH"' >> ~/.zshrc |
| 28 | +source ~/.zshrc |
| 29 | +``` |
| 30 | + |
| 31 | +## 3) Verify toolchain |
| 32 | + |
| 33 | +```bash |
| 34 | +bun --version |
| 35 | +qemu-system-aarch64 --version || qemu-system-x86_64 --version |
| 36 | +mke2fs -V |
| 37 | +debugfs -V |
| 38 | +``` |
| 39 | + |
| 40 | +## 4) Install dependencies and validate |
| 41 | + |
| 42 | +```bash |
| 43 | +bun install |
| 44 | +bun run test |
| 45 | +bun run typecheck |
| 46 | +bun run build |
| 47 | +``` |
| 48 | + |
| 49 | +## 5) Choose the build platform |
| 50 | + |
| 51 | +Use a platform that matches the architecture you will run in Gondolin. |
| 52 | + |
| 53 | +- Apple Silicon (`uname -m` => `arm64`): use `linux/arm64` |
| 54 | +- Intel Mac (`uname -m` => `x86_64`): use `linux/amd64` |
| 55 | + |
| 56 | +`oci2gondolin` defaults automatically from host arch if `--platform` is omitted, but passing it explicitly is recommended. |
| 57 | + |
| 58 | +Example: |
| 59 | + |
| 60 | +```bash |
| 61 | +bun run oci2gondolin -- \ |
| 62 | + --image busybox:latest \ |
| 63 | + --platform linux/arm64 \ |
| 64 | + --mode assets \ |
| 65 | + --out ./out/busybox-assets |
| 66 | +``` |
| 67 | + |
| 68 | +## 6) Run integration + smoke checks |
| 69 | + |
| 70 | +Apple Silicon: |
| 71 | + |
| 72 | +```bash |
| 73 | +INTEGRATION_PLATFORM=linux/arm64 bun run test:integration |
| 74 | +PLATFORM=linux/arm64 bun run e2e:smoke |
| 75 | +``` |
| 76 | + |
| 77 | +Intel Mac: |
| 78 | + |
| 79 | +```bash |
| 80 | +INTEGRATION_PLATFORM=linux/amd64 bun run test:integration |
| 81 | +PLATFORM=linux/amd64 bun run e2e:smoke |
| 82 | +``` |
| 83 | + |
| 84 | +## Troubleshooting |
| 85 | + |
| 86 | +### `mke2fs` / `debugfs` not found |
| 87 | + |
| 88 | +Confirm PATH includes the `e2fsprogs` `sbin` directory shown above. |
| 89 | + |
| 90 | +### Case-sensitive filename conflicts during conversion |
| 91 | + |
| 92 | +Some images include paths that conflict on case-insensitive filesystems. |
| 93 | + |
| 94 | +Use a case-sensitive APFS location for temporary work/output (for example, a case-sensitive volume) and retry. |
0 commit comments