Skip to content

fix(apple-container): three runtime bugs that break first-time setup#1323

Closed
lazure-ocean wants to merge 1 commit intoqwibitai:skill/apple-containerfrom
lazure-ocean:fix/apple-container-bugs
Closed

fix(apple-container): three runtime bugs that break first-time setup#1323
lazure-ocean wants to merge 1 commit intoqwibitai:skill/apple-containerfrom
lazure-ocean:fix/apple-container-bugs

Conversation

@lazure-ocean
Copy link
Copy Markdown
Contributor

Summary

Found and fixed three bugs in the skill/apple-container branch that cause setup to fail completely on a fresh macOS install.

  • Remove /dev/null host mount from container-runner.ts — Apple Container (VirtioFS) only supports directory mounts, not file/device mounts. Every container start crashed with path '/dev/null' is not a directory. The Dockerfile entrypoint already handles .env shadowing inside the VM via mount --bind (running as root), so this host-side mount is redundant.
  • Fix CONTAINER_HOST_GATEWAYhost.docker.internal is a Docker-specific hostname that Apple Container VMs don't have in /etc/hosts. The host is at the bridge100 interface IP (192.168.64.1). Now auto-detected; falls back to host.docker.internal for Docker Desktop.
  • Fix PROXY_BIND_HOST — The credential proxy was binding to 127.0.0.1, which isn't reachable from Apple Container VMs on 192.168.64.0/24. Now binds to the bridge100 IP when present; falls back to 127.0.0.1 for Docker Desktop.

Test plan

  • Fresh macOS setup with Apple Container — all three issues reproduced without this fix, resolved with it
  • Container starts successfully, .env is hidden from agent (verified mount --bind works inside VM)
  • Credential proxy reachable from inside container at 192.168.64.1:3001
  • Build clean, existing tests pass

🤖 Generated with Claude Code

1. Remove /dev/null host mount from container-runner.ts
   Apple Container (VirtioFS) only supports directory mounts, not file or
   device mounts. The /dev/null overlay used to shadow .env crashed every
   container start with "path '/dev/null' is not a directory". The
   Dockerfile entrypoint already handles .env shadowing inside the VM via
   mount --bind, so this host-side mount is redundant and must be removed.

2. Fix CONTAINER_HOST_GATEWAY for Apple Container
   host.docker.internal is a Docker-specific hostname injected into
   /etc/hosts by Docker Desktop. Apple Container VMs have no such entry.
   The host is reachable at the bridge100 interface IP (192.168.64.1).
   Now auto-detected via bridge100; falls back to host.docker.internal
   for Docker Desktop.

3. Fix PROXY_BIND_HOST for Apple Container
   The credential proxy was binding to 127.0.0.1 on macOS, which is not
   reachable from Apple Container VMs (they live on 192.168.64.0/24).
   Now binds to the bridge100 IP when present so containers can reach it.
   Falls back to 127.0.0.1 for Docker Desktop where loopback works.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gavrielc
Copy link
Copy Markdown
Collaborator

gavrielc commented Apr 3, 2026

Thank you for identifying this — the fix is now in #1609 (skill branch) and #1610 (main). You're credited as a co-author on both commits and added to CONTRIBUTORS.md. The final approach requires CREDENTIAL_PROXY_HOST in .env (set during /convert-to-apple-container) and fails fast if missing, rather than silently binding to 0.0.0.0 or the bridge IP. Closing in favor of those PRs.

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.

2 participants