Repository navigation
feat(docker): colima engine support for mac - #395
jelloeater-agent wants to merge 1 commit into
Conversation
Colima is now a first-class docker engine instead of being lumped into 'other'. Three things make the local provider behave correctly on it, plus the diagnostics and docs: - Detection: the probe reads docker info's OperatingSystem-Name pair, and 'colima' (the VM hostname colima writes into /etc/hosts at start) keys a new colima engine kind; engine.kind accepts colima as a pin. - host-gateway fix: runBox previously passed --add-host=host.docker.internal:host-gateway on every box. On colima that overrides the engine's native host.docker.internal -> macOS host mapping with the VM's docker0 gateway, cutting the box off from the host relay. The flag is now gated on addHostGateway (false for colima); every other engine keeps the current behavior. - Fail-fast guard: colima's file sharing (virtiofs/sshfs) presents bind mounts with macOS ownership, so the box user (vscode/1000) usually can't write the bind-mounted host .git and git worktree add dies with a cryptic EACCES. Create now probes writability as the box user when the engine is colima and fails with guidance (remote-docker against the same machine, or Docker Desktop/OrbStack) instead of the raw docker error, cleaning the container + provisional record up first. Remote-docker on a colima Mac already works (cloud-style sync, login-shell docker) and stays the supported colima path. Also: doctor/install hints name colima, vnc buildVncUrls accepts the wider engine union, and README + local-docker/remote-docker/configuration docs carry the colima notes. 8 new/updated tests; sandbox-docker (363), config (238) and the CLI suite (1662) are green.
|
@jelloeater-agent is attempting to deploy a commit to the madarco's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
All contributors have signed the CLA. Thank you! |
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
|
Signed this FYI |
|
Thanks @Jelloeater @jelloeater-agent, great contrib! I don’t have colima installed, the PR say you didn’t test this on colima? |
|
Correct — I could not test this on a live colima install, and I wanted to be transparent about that in the PR. The dev environment here is Linux with no macOS, so there is no colima VM available. What the colima-specific changes are based on instead:
The design is defensive on purpose: detection keys off the daemon Name, the host-gateway flag is omitted only for colima (every other engine gets byte-identical docker args), and the fail-fast probe verifies the If you do get a chance to run it on a colima Mac, |
|
thanks @Jelloeater if you use colima please test this before submitting, otherwise I'll add to my backlog and add colima support myself in the future |
|
Understood, and that is completely fair — untested engine-specific code should not land as "verified". To be clear on where that leaves this PR:
So the decision is yours: merge as-is with the documented caveat (the fail-fast guard means a real colima user gets a clear error, not breakage, even if my assumptions were wrong), or put it in your backlog and use the detection/gating work here as a starting point. Either way, happy to iterate if you or @Jelloeater can run the two check points in the local-docker.mdx Colima section. |
What
Adds Colima as a recognized docker engine on macOS, and makes the local docker provider behave correctly on it — plus clear guidance where colima's file-sharing can't host a local box. Reference design context: #207 (remote-docker) explicitly called out OrbStack/Colima as the break case, and remote-docker already supports colima Macs via its login-shell transport; this closes the local-engine gap.
Changes
Engine detection (
packages/sandbox-docker/src/sync/host-export.ts)DockerEnginegainscolima; the probe readsdocker info --format '{{.OperatingSystem}}|{{.Name}}'and keys offcolima— the VM hostname colima writes into the guest/etc/hostsat start (verified from colima's own start logs).engine.kind: colimais now a valid pin (config type + JSON schema + config docs).orbstackvs everything-else, so colima already behaves like Docker Desktop everywhere else (URLs, portless, stats) — no other behavior changes.host-gateway fix (
docker.ts,create.ts)runBoxalways passed--add-host=host.docker.internal:host-gateway. On colima this overrides colima's nativehost.docker.internal → macOS hostmapping (192.168.5.2 /host.lima.internal) with the VM's docker0 gateway (172.17.0.1) — the box then can't reach the host relay, breaking create and host actions. The flag is now gated on a newaddHostGatewayspec field, set tofalsefor colima. Every other engine keeps the exact current behavior.Fail-fast guard for colima local boxes (
create.ts,in-box-git.ts)vz, sshfs onqemu) presents bind-mounted macOS files with macOS ownership (uid 501), while the box's agent runs asvscode/uid 1000. agentbox's local provider bind-mounts the host.git/and runsgit worktree addas the box user — on colima that's a cryptic EACCES at create (unless the mac uid happens to be 1000).createnow probes writability of each bind as the box user when the engine is colima, and on failure tears down the container + provisional record and throws a clear, actionable error: use remote-docker against this machine (agentbox remote-docker add <alias> localhost, needs SSH/Remote Login) — which does work on colima (cloud-style sync, no.gitbind) — or Docker Desktop/OrbStack.Diagnostics + docs
buildVncUrlsaccepts the wider engine union; README,local-docker.mdx(new Colima section),remote-docker.mdx,configuration.mdxcarried the notes.Tests
unwritableGitBindprobe behavior, schema/coerce colima cases.@agentbox/sandbox-docker(363),@agentbox/config(238),@madarco/agentboxCLI (1662), fullpnpm build, eslint, prettier.Not verified (honest limitations)
colima,host.docker.internalmapping, file-ownership presentation per mount type) are verified against colima/lima issue reports and colima's own config (dnsHosts: host.docker.internal: host.lima.internal, VM/etc/hostswiring), not a live colima run. Theremote-docker-on-colima path was already documented as supported by feat(provider): remote-docker — run boxes on a machine you own, over SSH #207.