Skip to content

feat: experimental Apple Container support via socktainer, fixes #7372 - #8656

Merged
rfay merged 3 commits into
ddev:mainfrom
rfay:20260802_rfay_apple_container_experiment
Nov 25, 2026
Merged

rfay merged 3 commits into
ddev:mainfrom
rfay:20260802_rfay_apple_container_experiment

Conversation

@rfay

@rfay rfay commented Aug 2, 2026 •

Copy link
Copy Markdown
Member

Short Summary (TL;DR)

DDEV detects Apple Container behind socktainer and adapts to it, so projects start and run there. Support is marked experimental, and nothing changes on other providers.

The Issue

Apple Container runs each container in its own VM. A named volume takes either one read-write attachment or any number of read-only ones. A Unix socket in one container can't be reached from another. Ports below 1024 can't be published. socktainer, the Docker-compatible API in front of it, still has gaps. Most of the volume sharing DDEV used to depend on was removed upstream for #8895 (#8945, #9024, #8956, #8944, #9041, #9042, #9045). #9040, #9046, #9061, #9108, #9115 and #9121 also came out of this work; #9108 already pulls linux/<arch> images and matches volume holders by Mounts on socktainer. What's left is here.

How This PR Solves The Issue

DDEV detects the provider through socktainer's docker version output (IsAppleContainer()). Every change below applies only on that provider.

  • ddev version, ddev utility dockercheck, ddev utility port-diagnose and instrumentation report the provider as apple-container.
  • ddev start and ddev utility dockercheck warn when socktainer is older than 1.6.1. Builds from source report no release version, so DDEV doesn't compare them.
  • ddev-ssh-agent is always omitted, because web can't attach a volume another VM holds. With ssh_agent_upstream set, web bind-mounts that host socket directly, and Apple Container relays it into the VM. host uses SSH_AUTH_SOCK. ddev auth ssh explains this instead of adding keys to an agent web can't reach.
  • CopyIntoContainer extracts with tar inside the container. socktainer 1.6.1 ignores a gzipped archive (socktainer#484) and drops each file's owner and mtime (socktainer#514). Both are fixed on socktainer main but not released.
  • The mkcert CA archive leaves out its directory entry, which a never-started container refuses (socktainer#502).
  • Project images build one service at a time. Concurrent image loads can leave a tag on its old image (socktainer#518), and Compose's bake build loads them all at once. Compose's concurrency limit doesn't reach the bake path, so DDEV calls Build once per service.
  • host.docker.internal is host-gateway, which socktainer resolves to the network gateway where the Mac answers.
  • Add-on installs get the same virtiofs propagation delay as Lima and Colima.
  • Docs: an experimental Apple Container tab on the macOS Docker installation page, with setup, the Local Network prompt, SSH keys, limitations and a fix for a hanging container system start.

Mutagen works and is the default, as on any macOS provider.

Known limitations, each documented or named by a test skip:

Manual Testing Instructions

This needs macOS 26 on Apple silicon. The setup is in the new docs tab: https://ddev--8656.org.readthedocs.build/en/8656/users/install/docker-installation/

The steps below start Apple Container and socktainer by hand, as the docs do. #9185 proposes running both with brew services instead, and lists what to check first. To test that way, follow its steps in place of container system start and socktainer &.

brew install socktainer docker docker-buildx
container system start
socktainer &
docker context use socktainer
ddev utility download-ddev --pr 8656
export PATH="$HOME/tmp/ddev-download-ddev/pr-8656:$PATH"
ddev config global --router-http-port=8080 --router-https-port=8443 --ssh-agent-upstream=host
mkdir -p ~/tmp/appletest && cd ~/tmp/appletest
echo '<?php echo gethostname();' > index.php
ddev config --project-type=php --docroot=.
ddev start -y
# Expect: macOS asks to allow container-runtime-linux on the local network the first time; click Allow
curl -s http://appletest.ddev.site:8080/
# Expect: appletest-web
ddev mutagen st -l | grep Status
# Expect: Status: Watching for changes
ddev exec ssh-add -l
# Expect: the keys that `ssh-add -l` lists on the host
ddev auth ssh
# Expect: an explanation that web uses the host's agent directly
ddev utility dockercheck
# Expect: socktainer version: 1.6.1

On another provider, run ddev debug compose-config in a project. Confirm that web still mounts ddev-ssh-agent_socket_dir and that host.docker.internal is unchanged.

Automated Testing Overview

The Buildkite pipeline macos-socktainer runs the suite with DOCKER_TYPE=socktainer and router ports 8080/8443. It runs on testbots with Apple Container 1.7.1 and socktainer 1.6.1. Build 40 passed on this branch before it was squashed.

  • TestAppleContainerSSHAgent covers the host-agent mount. The ddev-ssh-agent tests skip there.
  • Tests that hit a known socktainer or Apple Container gap skip on IsAppleContainer(), and each skip names its cause.
  • SkipUnlessDefaultEnvironment still skips its tests there through its Mutagen check.

Release/Deployment Notes

Apple Container support is experimental. The macos-socktainer pipeline builds only this branch, so its branch filter needs widening after merge. Follow-up: #9185, setup with brew services.

🤖 Generated with Claude Code

@rfay

rfay commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

Status update: socktainer upstream engagement

The blocker that mattered most for this PR — ddev start never returning from
GetRouterConfigErrors() — is now root-caused and fixed on both sides:

Six more socktainer fixes (DNS wrong-network address, version reporting,
archive-on-unstarted-container, healthcheck timing, --filter name=, docker cp
directory hang) are written, tested, and DCO-signed-off, queued to submit upstream one
at a time next. Rather than duplicate that here, per-blocker status now lives in this
branch's HANDOFF.md, alongside a link to the full ranked rollout plan.

Also open, independent of any socktainer fix landing: #8657, #8658, #8659 — DDEV-side
hardenings this investigation surfaced.

@rfay

rfay commented Aug 3, 2026 •

Copy link
Copy Markdown
Member Author

Next steps to try to verify against the socktainer fixes ahead of merge

Remaining steps

  • fix(exec): close hijacked exec-start channel even when wait() stalls, fixes #346 socktainer/socktainer#347: address review feedback, get it merged.
  • Submit the other six ready fixes upstream, one at a time in this order (per
    UPSTREAM_ROLLOUT.md's ranking, tiebreaking on diff risk): DNS wrong-network address →
    version reporting → archive-on-unstarted-container → healthcheck timing →
    --filter name= → docker cp directory hang.
  • Once the two ddev start-blocking fixes (exec-hijack + DNS wrong-network address) are
    in a released socktainer build, redo the cold-start recipe in HANDOFF.md against a
    real release rather than a local build, to confirm nothing about the local-build
    technique below was masking a packaging-level difference.
  • Tracking: Docker Engine API v1.51 feature parity socktainer/socktainer#14 (underscore container names) needs a decision independent of
    the above: close as not-reproducible, or get a sharper repro from the original reporter.

Verifying locally, ahead of any of this merging upstream

Every fix above is DCO-signed-off and individually tested in the rfay/socktainer fork,
so they can be exercised locally right now instead of waiting on upstream review:

cd ~/workspace/socktainer
git checkout -b tmp/rollout-verify main
git merge --no-edit \
  fix/exec-hijack-close fix/dns-wrong-network-address fix/version-engine-version \
  fix/archive-404-prestart fix/healthcheck-timing fix/filter-name-ignored \
  fix/cp-directory-hang
make release

Swap the built binary in for the Homebrew-managed daemon (it reads the real $HOME, so
DockerContextSetup recreates the same socktainer docker context /
~/.socktainer/container.sock already registered — no docker context changes needed):

brew services stop socktainer
~/workspace/socktainer/.build/release/socktainer &

Then re-run the cold-start recipe from this branch's HANDOFF.md (keepalive container,
gateway dnsmasq, hand-recreated buildkit node) and ddev start a test project. What to
look for: whether ddev start now returns instead of hanging in
GetRouterConfigErrors(), and whether the page actually serves instead of a 502 (the
DNS wrong-network-address fix is what should resolve that last hop). Restore the normal
daemon afterward regardless of outcome:

brew services start socktainer

Findings from that run will fold back into HANDOFF.md rather than a follow-up comment
here.

@rfay

rfay commented Aug 4, 2026 •

Copy link
Copy Markdown
Member Author

socktainer status: DDEV now works end to end on Apple Container

Updated. This comment originally ended at "ddev start succeeds but nothing is reachable from the host." That last blocker turned out to be macOS Local Network authorization scoped to a binary path — Homebrew's container had no authorization, the signed installer's did. With container installed from the signed installer, DDEV serves at its real URLs. Details in the Apple Container comment.

Practical result as of today, with the fixes below applied, container 1.2.0 from the signed installer, and a plain PHP project:

http://appletest.ddev.site:8080/    → 200
https://appletest.ddev.site:8443/   → 200   (phpinfo, PHP 8.4.24)
http://127.0.0.1:57118/             → 200   (web's own host binding)
https://appletest.ddev.site:33001/  → 200   (Mailpit)
ddev ssh / ddev exec / mysql        → all work

ddev start exits 0, all three containers report healthy in ~10s each, images build in ~1m15s, and the traefik → web hop resolves. Reached at DDEV's advertised hostnames from the host — no container IP, no hand-set Host header.

Still required by hand, and none of it addressed by the queued branches:

  • router_http_port / router_https_port above 1024 (Apple Container can't bind privileged ports)
  • performance_mode: none and omit_containers: [ddev-ssh-agent] (shared-volume limits)
  • shortened healthcheck timings via compose overrides
  • traefik_monitor_port that doesn't collide with another running router
  • project containers removed before ddev start (the db-volume conflict, which ddev/ddev#8658 fixes)
  • the cold-start recipe (a container alive on default, host dnsmasq on the gateway, a hand-created buildkit node)

So: a working proof of concept that needs real design work before it's a supported provider, not a finished feature. Apple Container's own limits are in the separate comment.


Three new socktainer bugs found, root-caused and fixed

These are local, uncommitted work in a ~/workspace/socktainer working tree on a scratch branch (the seven queued branches merged onto main). Nothing is pushed, so there is no branch link for them yet, and no fork issue filed for the first or third.

1. Exec upgrade gating — the actual cause of ddev start hanging

shouldUpgrade required attachStdin, so a client attaching only stdout/stderr while sending Connection: Upgrade / Upgrade: tcp got no HTTP response at all: no status line, no bytes, no close, hanging until the client's own timeout. Verified against released 1.2.1. The identical request without the upgrade headers returns a correct chunked response in 0.1s.

Fix is one condition removed — hijack whenever the client asks, as moby does. dockerutil.Exec went from hanging against every container to returning in 0.12s.

This supersedes rfay/socktainer#8 and the now-closed socktainer/socktainer#346 — see "corrected diagnoses" below. rfay/socktainer#8 is still open and still carries the wrong framing.

2. DNS replies malformed whenever the query carries EDNS0 — this was the 502

socktainer/socktainer#329 (filed by someone else) already names EDNS0 as the trigger; the mechanism is that buildAResponse/buildNodataResponse copy the whole query — OPT record included — set ARCOUNT=0, and then append the answer RR after those leftover OPT bytes. A strict parser reads the answer section where the counts say it is, lands on OPT, and reports no usable data. getent worked throughout only because it doesn't send EDNS0, which is what made this look like an A-vs-AAAA problem.

Fix: truncate the reply at the end of the question before appending answers, and claim no OPT. curl http://ddev-appletest-web/ from inside ddev-router goes 502 → 200.

Note this is not rfay/socktainer#7 / fix/dns-wrong-network-address — that is a real but separate bug, and it was not what caused the 502.

3. Container filter parsing dropped every key except label

The Docker CLI encodes filters as {"key":{"value":true}}; that form was handled only for label, so name, status and id were discarded before any matching ran. docker ps -a --filter name=doesnotexist still listed every container.

This is the missing half of rfay/socktainer#9 — see below. DDEV itself was never exposed to it, since FindContainerByName re-checks Names[0] against the exact name.


Problems found in the already-queued fork branches

Each of the seven was individually tested before this run. Exercising them together against a real ddev start found that three were wrong or incomplete.

fix/exec-hijack-close — was socktainer/socktainer#347, now closed

It bounds the hijacked exec channel at 10s and closes it whether or not the process exited, so every image build fails — buildx's buildctl dial-stdio is exactly such a long-lived exec:

target db: failed to receive status: rpc error: code = Unavailable desc = error reading from server: EOF

Same command, both daemons:

socktainer docker exec -i keepalive sh -c 'sleep 30; echo done-30'
1.2.1 Homebrew bottle done-30, 30.2s, exit 0
local build with #347 no output, 10.1s, exit 255

A timeout is the wrong mechanism: a stalled XPC wait() cannot be told apart from a process that is still running. Output-pipe EOF can be — Apple Container closes the container-side write ends when the exec process exits, so EOF is the exit signal and it arrives whether or not XPC acknowledges anything. Reworked locally to close on EOF and start the 10s bound there, only to collect the numeric exit code. The chunked-stream path in the same file already worked this way.

Both #347 and #346 are now closed. What should be filed instead is the gating fix above, plus close-on-EOF as a separate, honestly-scoped robustness change.

fix/filter-name-ignored — rfay/socktainer#9

Fixed the matching semantics (substring, like real Docker) but not the parsing, so the filter never reached the corrected code. Incomplete without new fix 3 above.

fix/version-engine-version — rfay/socktainer#13

Works as designed but doesn't achieve the goal. DDEV then warns installed Docker version 0.0.0-dev is not supported, please update to version 25.0 or newer, and a tagged 1.2.x release would fail the same >= 25.0 check. The real fix is a socktainer-aware version check on the DDEV side.

Untouched and still believed good

fix/dns-wrong-network-address (#7), fix/archive-404-prestart (#10), fix/cp-directory-hang (#11). fix/healthcheck-timing (#12) was in the build but is untested — the project kept its shortened healthcheck overrides all session, so whether DDEV's default interval 1s / timeout 70s / start_period 120s now works was never exercised. rfay/socktainer#14 stays closed as not reproducible.


Corrected diagnoses

Worth recording, because two of these sent earlier work down the wrong path:

  • The exec hang is not a teardown bug. rfay/socktainer#8 and closed socktainer/socktainer#346 both state that output arrives byte-for-byte and only the post-exit close fails. In fact zero bytes arrive and no HTTP response is ever sent. The hijacked path closed correctly in every case I could produce on 1.2.1.
  • docker exec without -it does hijack. Running ddev start should create a ddev managed Drupal settings.php #346 says it "uses the codepath that doesn't hijack"; instrumented logging shows it sending the same upgrade headers with attachStdin=false. That assumption is what pointed the diagnosis at the wrong code.
  • The 502 was EDNS0 malformation, not the multi-homed-address bug. Blocker 3's second half was a red herring for this symptom.
  • A surviving buildkit node does not need recreating after a socktainer restart. ddev debug rebuild built both images in 9s against a node that predated the restart. Recreation is only needed once the node itself has exited.

New socktainer behaviors, no issue filed yet

  • Compose recreate-by-rename collides with hostname uniqueness. Compose recreates a container by renaming the old one aside (POST /containers/create?name=<hash>_ddev-router) and creating the replacement under the original name. Renaming does not move the container's hostname, and Apple Container enforces hostname uniqueness globally, so the create is rejected: Failed to create container: exists: "hostname(s) already exist: ["ddev-router"]". This makes ddev restart exit 1 and ddev debug rebuild fail at the router; the router left running is a stale survivor. Same shape as the shared-volume blocker — any DDEV path going through compose's recreate rather than removing containers first will hit it.
  • Health status resets to starting for every container after a daemon restart and stays there while the containers keep working normally. ddev restart clears it (all three healthy in ~35s).
  • brew services start socktainer is unusable with the standard docker context. The service runs with HOME=/opt/homebrew/var/run/socktainer, so it binds /opt/homebrew/var/run/socktainer/.socktainer/container.sock while the socktainer docker context points at ~/.socktainer/container.sock. The daemon has to be run by hand.

Open unknowns

  • Why the docker CLI escapes the gating hang. curl and DDEV's Go client both hang on what appears to be an identical request; the CLI succeeds. Most likely client-side (checking 101 vs 200 before taking over the socket), but curl's result doesn't fit that cleanly, so there may be a second bug where the chunked reply isn't terminated on that path. This needs settling before the gating bug is filed upstream, or the description risks being wrong in a subtler way than Running ddev start should create a ddev managed Drupal settings.php #346 was.
  • Whether the XPC stall Revert "Use named volumes for MySQL volume" #347 guarded against exists at all. Never reproduced — though released main does gate the channel close on an unbounded process.wait(), so the concern is real in the code even if unobserved.
  • The socktainer unit suite cannot be run in this environment. It compiles, but swift test can't load Testing.framework — only the _Testing_* overlays ship with Command Line Tools; running the suite needs full Xcode. So all verification here is behavioral, not unit-tested.
  • ddev ssh interactively — reported broken, not reproduced. A pty-driven session with piped input worked; a live session holding stdin open is a different case and remains unverified.

DDEV-side PRs from this investigation

Four are open as drafts. Each is based on main, not on this branch, and each stands alone as a provider-independent fix:

  • ddev/ddev#8657 (20260802_rfay_bound_host_ports_fallback) — fall back to NetworkSettings.Ports in GetBoundHostPorts
  • ddev/ddev#8658 (20260802_rfay_existing_db_type_no_volume_conflict) — read the db version via exec instead of a second volume mount
  • ddev/ddev#8659 (20260802_rfay_global_cache_chown_non_fatal) — don't let a failing global-cache chown kill the web container
  • ddev/ddev#8660 (20260802_rfay_dockerutil_exec_no_hijack) — stop hijacking the exec stream in Exec()

None of the four was in the binary used for the socktainer testing above — that binary was built from this branch (#8656) alone. Worth knowing when reading the results: #8658's absence is why every ddev start above required removing the web and db containers first, and #8659's absence was worked around inside the test project with a sed hack in .ddev/web-build/Dockerfile. #8657 and #8659 have therefore never been exercised against socktainer at all.

#8660 alone unblocks the hang, against completely stock socktainer — measured

DDEV's unconditional hijack request is exactly what triggers socktainer's silent no-response, so #8660 removes the hang with nothing needed from upstream. Verified directly: #8660 merged into this branch, run against the released 1.2.1 Homebrew bottle with none of the socktainer fixes applied:

Successfully started appletest        # exit 0, 1m55s, images built, all three containers healthy

ddev exec php -v works in that configuration too. What does not work there: the site returns 502, because the EDNS0 malformation is still present and traefik cannot resolve ddev-appletest-web — so the DNS fix is what takes it from 502 to 200. Host access remains blocked by port publishing either way.

So the useful split is: #8660 fixes the hang today with no upstream dependency, the DNS/EDNS0 fix is needed for the last routing hop, and port publishing blocks host reachability regardless of both.

@rfay

rfay commented Aug 4, 2026 •

Copy link
Copy Markdown
Member Author

Apple Container frictions — and the port blocker turned out to be an install-method problem

Companion to the socktainer comment above, which covers socktainer's own bugs. This one is about limits that belong to Apple Container / macOS.

Resolved while writing this: the port blocker was not an Apple Container limitation at all. It was macOS Local Network (TCC) authorization, which is scoped to a binary path — and the authorized path was the signed installer's, not Homebrew's. Installing container from the signed installer made published ports work immediately, and DDEV then came up fully reachable at its real URLs from the host. Details in section 1.

That leaves exactly one genuine architectural friction on this platform: shared writable volumes.

Environment for everything below: macOS 27.0 beta (26A5388g), container 1.2.0, Apple Silicon.


1. Published ports reset — SOLVED: Local Network authorization is scoped to a binary path

Bottom line: install Apple Container from the signed installer, not Homebrew, or published ports silently fail. Same version, same OS, same config — only the install path differs, and that decides whether macOS grants Local Network access.

The proof, run end to end today:

Install container run -d -p 127.0.0.1:38080:80 nginx:alpine → curl
Homebrew container 1.2.0 (/opt/homebrew/…) curl: (56) Recv failure: Connection reset by peer
Signed installer container 1.2.0 (/usr/local/…) 200 (3/3 attempts; a second port also 200)

Then, with nothing else changed but the install:

http://appletest.ddev.site:8080/    → 200
https://appletest.ddev.site:8443/   → 200   (phpinfo, PHP 8.4.24)
http://127.0.0.1:57118/             → 200   (web's own binding)
https://appletest.ddev.site:33001/  → 200   (Mailpit)
ddev ssh / ddev exec / mysql        → all work

That is DDEV reachable at its advertised URLs from the host — no container IP, no hand-set Host header. First time in this investigation.

Why the install path matters

/Library/Preferences/com.apple.networkextension.plist (readable with sudo, no Full Disk Access needed) stores one record per authorized binary, as a (Path, SigningIdentifier) pair:

"Path"              => "/usr/local/libexec/container/plugins/container-runtime-linux/bin/container-runtime-linux"
"SigningIdentifier" => "com.apple.container.container-runtime-linux"

It is path-keyed, not app-keyed — Google Chrome has a dozen records, one per code_sign_clone path, which is why System Settings shows a dozen identical "Google Chrome" rows; GoLand has two. So the single enabled container-runtime-linux row in System Settings → Privacy & Security → Local Network belongs to /usr/local/…, and the Homebrew binary at /opt/homebrew/Cellar/container/1.2.0/libexec/… had no record at all.

Unauthorized, the helper binds the host listener fine, accepts the client connection, and then fails its backend connect:

container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] backend - connect failed:
connect(descriptor:addr:size:): No route to host) (errno: 65)
[proxy=[IPv4]127.0.0.1/127.0.0.1:38080] [uuid=porttest]

errno 65 is EHOSTUNREACH — the same signature as apple/container#2067, which was closed with exactly this root cause ("the macOS Local Network privacy prompt (TCC), not a forwarder bug … the only failure mode is the silent pre-approval window").

No prompt ever appears for the Homebrew copy, and there's a plausible reason: the helper runs as a launchd-registered service, and TCC prompts generally cannot surface from a daemon with no UI session. So a Homebrew install has no path to authorization through normal use — it fails silently and permanently, while tccd is visibly evaluating the binary at connect time.

Consequences

  • DDEV docs should say: use the signed installer from apple/container releases, not brew install container. This is invisible otherwise and looks exactly like a broken provider.
  • apple/container#2029 (open, macOS 27 beta, same nginx repro) may well be this same issue from the other direction and is worth a comment — though note that reporter said they were on the signed installer, so it isn't a certain match.
  • ddev/ddev#8657 (bound-host-ports fallback) can now be exercised against a working forwarder, which was impossible before.
  • Ports below 1024 are still unbindable — see section 2. That constraint is real and unaffected by any of this.
Original diagnosis, kept for the record

Published ports reset — an OS-level problem, not an Apple Container limit

This is the current blocker, and it is not DDEV-specific. Two commands, stock nginx, no DDEV and no compose involved:

docker run -d --name porttest -p 127.0.0.1:38080:80 nginx:alpine
curl http://127.0.0.1:38080/          # curl: (56) Recv failure: Connection reset by peer
curl http://192.168.64.102/           # 200 OK — direct to the container IP works

The port genuinely listens (lsof shows the container helper holding 127.0.0.1:38080). What fails is the helper's backend connect, and the system log names the errno:

container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] backend - connect failed:
connect(descriptor:addr:size:): No route to host) (errno: 65)
[proxy=[IPv4]127.0.0.1/127.0.0.1:38080] [uuid=porttest]

errno 65 is EHOSTUNREACH. There are two upstream issues with this symptom, and our environment matches one on the OS version and the other on the errno, so both are live candidates:

Candidate A — macOS 27 beta regression. apple/container#2029 (open) reports the identical nginx:alpine / -p 127.0.0.1:8080:80 repro and the identical curl: (56) Recv failure: Connection reset by peer, explicitly on macOS 27 beta, with Apple Feedback FB24027799 filed. Same OS train we're on. If this is it, there's nothing to do but wait for an OS or container fix.

Candidate B — unapproved macOS Local Network prompt (TCC). apple/container#2067 (closed as completed) has the same EHOSTUNREACH-on-backend-connect signature, and its resolution was:

this was the macOS Local Network privacy prompt (TCC), not a forwarder bug. After approving the prompt, --publish works correctly […] The only failure mode is the silent pre-approval window, where the helper's backend connect fails with EHOSTUNREACH and the user never sees a prompt unless they happen to open [System Settings].

That report was on macOS 26.6, not 27, which is the reason to weigh it below A. But tccd is demonstrably in the loop for the helper here — it evaluated it five seconds before the failed connect:

tccd: [com.apple.TCC:access] AUTHREQ_SUBJECT: msgID=27112.1,
subject=…/container-plugins/container-runtime-linux/bin/container-runtime-linux

(apple/container#1702, closed, is the same symptom pair on 1.0.0 — prior art for both.)

Evidence that shifts this toward B: the authorized path isn't the one running. /Library/Preferences/com.apple.networkextension.plist (readable with sudo, no Full Disk Access needed) carries exactly one Local Network record for the helper:

180 => "com.apple.container.container-runtime-linux"
181 => "/usr/local/libexec/container/plugins/container-runtime-linux/bin/container-runtime-linux"

That is the signed-installer path. The helper actually running is the Homebrew one:

/opt/homebrew/Cellar/container/1.2.0/libexec/container-plugins/container-runtime-linux/bin/container-runtime-linux

and the plist contains zero /opt/homebrew entries. So the process whose backend connect fails with EHOSTUNREACH has no Local Network record at all, while a differently-installed copy of the same helper does — consistent with an approval that was granted once for the installer build and does not carry over to a Homebrew build at a different path.

And the store is path-keyed, not app-keyed. Google Chrome has one record per code_sign_clone path (a dozen of them, which is why System Settings shows a dozen identical "Google Chrome" rows), and GoLand has two — /Applications/GoLand.app/… and its JetBrains client cache path. So authorization does not follow "the app"; it follows a specific binary at a specific path.

System Settings → Privacy & Security → Local Network does list container-runtime-linux, enabled. Given path-keying, that row is the /usr/local/libexec installer binary — the only one in the store — and not the Homebrew binary doing the failing connect.

There is also a plausible reason the Homebrew copy never produced a prompt: it runs as a launchd-registered service, and TCC prompts generally cannot surface from a daemon with no UI session. That is precisely #2067's "silent pre-approval window", and it would mean a Homebrew-installed Apple Container may never be able to get Local Network authorization on this OS, while the signed installer can. If that holds it's worth knowing well beyond DDEV.

Still unproven: that this plist is the authoritative store, and that absence of a record means denied rather than never-asked. Candidate A also stays alive because #2029's reporter was on the signed installer (1.1.0) and still failed on macOS 27 beta.

The decisive test is therefore to run the signed-installer build at the already-authorized /usr/local/libexec path and repeat the two-command nginx repro. A 200 there confirms path-scoped Local Network authorization as the cause and makes this an installation-method problem, not an Apple Container limitation. A reset there instead rules candidate B out and makes it #2029.

(That test was run: 200. Candidate B confirmed, candidate A ruled out.)

Either way the conclusion for this PR is the same: port publishing is broken below Apple Container, not by it, and no DDEV or socktainer change fixes it. What that promotes is the "Apple Container mode" idea already sketched in the branch's HANDOFF.md — skip publishing entirely, point project hostnames at the router's container IP, which is directly reachable from the host (200 in the repro above) and needs no privileged ports either. On this OS that is currently the only working route, so it moves from curiosity to the only viable design. It also means ddev/ddev#8657 (bound-host-ports fallback) has never been exercised against a functioning forwarder here and should be, once one exists.


2. Ports below 1024 cannot be published — a real platform constraint

Separate from the above, and not fixable by approving anything. The forwarder runs unprivileged, so DDEV's default configuration is rejected outright:

invalidArgument: "Permission denied while binding to host port 443.
Binding to ports below 1024 requires root privileges."

Not a new class of problem for DDEV — rootless Podman is already a supported provider with the same restriction, and docs/content/users/install/docker-installation.md documents it. The macOS-specific part is that Linux offers net.ipv4.ip_unprivileged_port_start=0 as an escape hatch and macOS has no equivalent, so unprivileged router ports (router_http_port: "8080" / router_https_port: "8443") are mandatory here rather than merely recommended.


3. A writable named volume can be attached by exactly one container — the one genuine architectural friction

Each named volume is an ext4 disk image, and Virtualization.framework cannot attach one writable block device to two VMs. Re-verified today against the current build:

Volume held by New :ro attach New RW attach
nothing works works
one RW container fails (500) fails (500)
one or more :ro containers works (2 tested; 3 previously) fails

Writing from inside a :ro reader gives Read-only file system; re-seeding RW while readers are up fails. Where DDEV collides:

  • ddev-global-cache — mounted simultaneously by web, db, router, ssh-agent and every RunSimpleContainer helper. The worst case. Worked around on this branch by bind-mounting ~/.ddev/global-cache-bind instead, switched on automatically by IsSocktainer().
  • ddev-ssh-agent_socket_dir — ssh-agent + web. Not bind-mountable (unix sockets over virtiofs are unreliable), so omit_containers: [ddev-ssh-agent] is the only tested option.
  • <project>_project_mutagen — with Mutagen on, the web container mounts it twice by itself (/var/www and /tmp/project_mutagen), failing within a single container. This is why performance_mode: none is mandatory, not advisory.
  • the db volume — GetExistingDBType and the snapshot helpers mount it while ddev-<project>-db runs, which is why ddev start against an already-running project always fails and why every start in this session needed the containers removed first. ddev/ddev#8658 fixes that specific case.

The nuance that matters: the exclusivity belongs to block devices, not to Apple Container storage generally. Virtiofs bind mounts are shareable read-write — which is exactly why the global-cache workaround works. So this is routable rather than terminal: backing docker volume create with host directories instead of disk images makes it disappear, at virtiofs performance instead of block performance. Today docker volume create --driver local -o type=none -o device=… -o o=bind is ignored and still produces a block volume, which is a socktainer-side choice rather than a platform limit.

This is the only friction on this list that needs DDEV architecture thought rather than configuration; the design options are enumerated in the branch's HANDOFF.md (split the cache by write pattern, seed-then-mount-:ro, per-project volumes, or a caching proxy for the download caches).


4. No DNS on the built-in default network

Containers get nameserver 192.168.64.1 (the vmnet gateway) and nothing listens there, so every lookup is refused. This breaks anything on default — including Apple's own build VM, where container build fails at apk add with a DNS transient error. Workaround is a host-side dnsmasq bound to the gateway, forwarding to socktainer's DNS, which in turn only binds once a container is already running on that network. socktainer supplies DNS for the networks it creates, so this gap is specifically Apple Container's.


5. vmnet does not survive idling or churn

Two distinct decay modes, both below socktainer:

  • A DNS sidecar becomes unreachable (100% packet loss) after a few minutes idle while still reporting running. Restarting it assigns a new IP, and already-running containers keep the stale nameserver in /etc/resolv.conf.
  • After roughly an hour of moderate churn, 192.168.64.1 vanished from every host interface while container network inspect default still reported it as the gateway. dnsmasq then cannot rebind, and recovery needs container system stop && container system start.

This is what makes a cold-start recipe necessary at all, and it's the thing most likely to make the setup feel unreliable day to day.


6. --privileged is a documented no-op

Virtualization.framework has no capability model to honor it, so buildkit's rbind fails with operation not permitted. Workaround is --cap-add ALL on a hand-created buildkit node. Intentional per socktainer's README rather than a bug.


7. Global hostname uniqueness breaks compose's recreate

Apple Container enforces hostname uniqueness across containers, and renaming a container does not move its hostname. Compose recreates by renaming the old container aside and creating the replacement under the original name, so the create is rejected:

Failed to create container: exists: "hostname(s) already exist: ["ddev-router"]"

That makes ddev restart exit 1 and ddev debug rebuild fail at the router. Probably addressable in socktainer's registration handling rather than a platform limit, so I've left it off the "fundamental" list.


Two things I had wrong

  • "Only one network per container" is false. Multi-homing at create time works: docker inspect ddev-appletest-web reports ddev-appletest_default=192.168.253.7 ddev_default=192.168.254.11. Only hot-attach (docker network connect after creation) is a no-op, Virtualization.framework having no NIC hotplug. This is also why the multi-homed DNS bug (rfay/socktainer#7) can exist at all.
  • chown -R failing on a bind mount is not an Apple Container issue. It's ordinary macOS bind-mount behavior on every Docker provider, and it only appeared here because this branch swaps the global-cache volume for a bind mount. A named volume never hits it. ddev/ddev#8659 is still worth having — and it's a prerequisite for any bind-mount approach to the global cache, including bind-mounting mkcert/ and global-commands/ read-only, which would hit the same wall on Docker Desktop, OrbStack and Colima.

Net

After the port question resolved, the genuinely Apple-Container-shaped list is short:

  • One architectural problem — shared writable volumes (section 3), and even that is routable by backing volumes with virtiofs instead of block images. This is the only item needing DDEV architecture thought.
  • Two constraints to design around — no privileged ports (section 2), no DNS on the built-in default network (section 4).
  • One reliability problem — vmnet decay on idle and churn (section 5), which is what makes a cold-start recipe necessary.
  • One documented no-op — --privileged (section 6).
  • One probably-fixable-in-socktainer wrinkle — global hostname uniqueness vs. compose's recreate (section 7).

And one item that looked like the worst of them and wasn't Apple Container's fault at all: port publishing, which was Local Network authorization scoped to the wrong binary path. With the signed installer, DDEV serves at its real URLs.

@rfay
rfay force-pushed the 20260802_rfay_apple_container_experiment branch from 137ae3e to 28646b8 Compare August 4, 2026 14:49
@rfay rfay changed the title chore: experimental Apple Container/socktainer investigation, for #7372 feat: experimental Apple Container/socktainer implementation, for #7372 Aug 4, 2026
@rfay
rfay force-pushed the 20260802_rfay_apple_container_experiment branch from 1ff4a2d to 739d33e Compare August 5, 2026 14:02
@rfay
rfay force-pushed the 20260802_rfay_apple_container_experiment branch 2 times, most recently from e3c3202 to 72074ff Compare August 11, 2026 20:29
@rfay
rfay force-pushed the 20260802_rfay_apple_container_experiment branch 2 times, most recently from 40c75ed to 5e41ea5 Compare August 24, 2026 20:55
@rfay
rfay force-pushed the 20260802_rfay_apple_container_experiment branch from 5e41ea5 to f431f2b Compare August 28, 2026 20:39
@rfay

rfay commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

@rfay
rfay force-pushed the 20260802_rfay_apple_container_experiment branch 2 times, most recently from 2ac297b to f2f0729 Compare September 23, 2026 02:44
@benoitf

benoitf commented Oct 8, 2026

Copy link
Copy Markdown

hello @rfay let me know if there is something missing from socktainer side

@rfay

rfay commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Thanks @benoitf ! There are several things, thanks so much for your interest! The HANDOFF.md shows the current state, and there are issues in rfay/socktainer for the things. I'm reluctant to post AI-generated issues/PRs to socktainer/socktainer without knowing what I'm doing.

@benoitf

benoitf commented Oct 8, 2026

Copy link
Copy Markdown

@rfay do not hesitate to post issues, at least it's a good place to discuss them

I'll look at the md file

@rfay
rfay force-pushed the 20260802_rfay_apple_container_experiment branch 2 times, most recently from 6b3c110 to 65c1279 Compare November 18, 2026 17:05
@stasadev stasadev modified the milestones: v1.25.6, v1.26.0 Nov 20, 2026
@rfay
rfay force-pushed the 20260802_rfay_apple_container_experiment branch from b11f8d1 to e797b60 Compare November 23, 2026 22:30
@rfay rfay changed the title feat: Experimental Apple Container/socktainer implementation, fixes #7372 feat: experimental Apple Container support via socktainer, fixes #7372 Nov 23, 2026
@rfay
rfay marked this pull request as ready for review November 23, 2026 22:33
@rfay
rfay requested a review from a team as a code owner November 23, 2026 22:33
@rfay
rfay requested a review from stasadev November 23, 2026 23:23
@rfay
rfay force-pushed the 20260802_rfay_apple_container_experiment branch from e797b60 to 8db48c5 Compare November 24, 2026 03:13
@froboy

froboy commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

@rfay looks like such a huge amount of work... 👏 . I tested and ran into some issues. Claude helped me work it out.

From my agent...


Tested the manual checklist from this PR's description on macOS 27.2 (26B123), Apple Container 1.7.1, Apple silicon.

Full checklist passes, but only after working around a DNS bug in released socktainer 1.6.1:

  • ddev start -y, curl http://appletest.ddev.site:8080/ → appletest-web, ddev mutagen st -l → Watching for changes, ddev exec ssh-add -l matching host, ddev auth ssh explanation, and ddev utility dockercheck all green ✅

Blocker found: socktainer 1.6.1 (the version this PR's docs tell you to brew install) hardcodes its embedded DNS resolver's upstream to the default network's vmnet gateway (192.168.64.1 in my case). On a host where that address isn't actually a resolver, every DNS lookup from inside any container times out — including buildx's builder — so ddev start fails at the very first image build with:

failed to resolve source metadata for docker.io/ddev/ddev-dbserver-mariadb-11.8:v1.25.6: ... dial tcp: lookup registry-1.docker.io on 192.168.64.1:53: ... connection refused

This reproduced identically after a full clean reinstall (wiped ~/Library/Application Support/com.apple.container, fresh kernel, fresh container+socktainer install), so it isn't local corruption — 192.168.64.1 simply doesn't answer DNS on this network, and nothing in 1.6.1 falls back to the host's real resolvers.

Workaround: build socktainer from HEAD and run it with the new --dns-upstream auto flag (from socktainer#503, merged after 1.6.1 cut):

brew uninstall socktainer
brew install --HEAD socktainer
HOME="/opt/homebrew/var/run/socktainer" socktainer --dns-upstream auto &

With that, ddev utility dockercheck's "Able to use internet inside container" check goes from failing to passing, and the rest of the checklist completes cleanly.

Worth calling out in the docs tab (or raising SocktainerMinVersion past a release that includes --dns-upstream auto) since this will block ddev start outright for anyone whose LAN gateway isn't 192.168.64.1 — not just an edge case. Filed the DNS specifics as a standalone note for the socktainer side too if useful.

@rfay

rfay commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Thanks! I don't see that problem, and our automated tests are also succeeding with this configuration, but there are a number of PRs ahead of 1.6.1 that we're waiting for a release on, in addition to explicit support for container 1.7.1.

I guess if you're dependent on

you must have a nonstandard DNS/network situation? Congrats on finding your way through it!

@froboy

froboy commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Strange... no non-standard DNS setup that I know of 🤦 turns out my VPN was doing strange things without me knowing...

Mullvad VPN is installed on this machine, and even though it's currently "Disconnected," its daemon keeps local network sharing set to block, which firewalls off the private/local-network ranges (192.168.x.x) persistently regardless of connection state. That includes 192.168.64.1, the default network's vmnet gateway that 1.6.1 hardcodes as its DNS upstream — so it's unreachable here, independent of anything socktainer or this PR does wrong.

--dns-upstream auto from #503 resolves through a different path that isn't caught by that same block, which is why it fixed things here. Makes sense your CI (plain network, no VPN firewall) never sees this. Should only bite people running Mullvad (or similar VPN clients with a "block LAN" policy) locally — not a general regression.

Sigh. Thanks robots.

I tried a real project too, and it works!!!

avi@Mac midcamp-event-platform %  export DOCKER_HOST=unix:///opt/homebrew/var/run/socktainer/.socktainer/container.sock
     export PATH="/Users/avi/tmp/ddev-download-ddev/pr-8656:$PATH"
     ddev describe
midcamp-ep  ~/Projects/midcamp-event-platform  https://midcamp-ep.ddev.site:8443
Docker platform: apple-container · Router: traefik · DDEV version: v1.25.6-14-g8db48c5ce
╭────────────────────────────────────────────────────────────────────────────────╮
│ SERVICE       STAT       URL/PORT                           INFO               │
├────────────────────────────────────────────────────────────────────────────────┤
│ web           ● OK       https://midcamp-ep.ddev.site:8443  drupal11 PHP 8.3   │
│                          InDocker -> Host:                  Server: nginx-fpm  │
│                           - web:80 -> 127.0.0.1:24518       Docroot: 'web'     │
│                           - web:443 -> 127.0.0.1:23777      Perf mode: mutagen │
│                           - web:8025 -> 127.0.0.1:26716     Node.js: 24        │
├────────────────────────────────────────────────────────────────────────────────┤
│ db            ● OK       InDocker -> Host:                  mariadb:10.11      │
│                           - db:3306 -> 127.0.0.1:29207      User/Pass: 'db/db' │
│                                                             or 'root/root'     │
├────────────────────────────────────────────────────────────────────────────────┤
│ xhgui         ○ stopped  https://midcamp-ep.ddev.site:8142                     │
│                          InDocker:                                             │
│                           - xhgui:80                                           │
│                          Launch: ddev xhgui                                    │
├────────────────────────────────────────────────────────────────────────────────┤
│ Mailpit                  https://midcamp-ep.ddev.site:8026                     │
│                          Launch: ddev mailpit                                  │
├────────────────────────────────────────────────────────────────────────────────┤
│ Project URLs             https://midcamp-ep.ddev.site:8443                     │
│                          https://127.0.0.1:23777                               │
│                          http://midcamp-ep.ddev.site:8080                      │
│                          http://127.0.0.1:24518                                │
╰────────────────────────────────────────────────────────────────────────────────╯

@rfay

rfay commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Awesome work, thanks for checking that out again.

I'm pretty thrilled that you found the --dns-upstream flag, even though it seems to be unusual-network stuff. We're going to need that at some point. I'm not sure how to handle that right now. Normally that kind of obscure stuff would belong in https://docs.ddev.com/en/stable/users/usage/networking/ but it seems too early to be adding fiddly info there.

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Everything is gated on IsAppleContainer(), and other providers behave the same. A few small things, none blocking.

  1. ddev utility port-diagnose prints apple container, while the other providers there are display names like Rancher Desktop. Maybe Apple Container?
  2. ddev-environment now reports apple-container, the same as docker-platform, and both go to Amplitude's identify event. That also makes pkg/environment import dockerutil. Do we need both? docker-platform already tells Apple Container apart, and ddev-environment could stay darwin.
  3. In GetHostDockerInternal(), the IsAppleContainer() case could set extraHost = "host-gateway" itself, without the second else if IsAppleContainer() below.

Claude Code compared this head (8db48c5) with its base (8c33daa) on Linux with Docker 29. ddev utility compose-config came out the same apart from the version string and random host ports, with ssh_agent_upstream both unset and set to host. ddev-ssh-agent still runs, and ssh-add -l in web lists the host key. The new published-port-check.sh passes there too. Nothing was run on Apple Container itself. That side relies on macos-socktainer build 42, which passed on this head, and on froboy's run.

🤖 Reviewed with assistance from Claude Code

rfay and others added 3 commits November 25, 2026 09:22
…#7372

## Short Summary (TL;DR)

DDEV detects Apple Container behind [socktainer](https://github.com/socktainer/socktainer) and adapts to it, so projects start and run there. Support is marked experimental, and nothing changes on other providers.

## The Issue

- Fixes ddev#7372

Apple Container runs each container in its own VM. A named volume takes either one read-write attachment or any number of read-only ones. A Unix socket in one container can't be reached from another. Ports below 1024 can't be published. socktainer, the Docker-compatible API in front of it, still has gaps. Most of the volume sharing DDEV used to depend on was removed upstream for ddev#8895 (ddev#8945, ddev#9024, ddev#8956, ddev#8944, ddev#9041, ddev#9042, ddev#9045). ddev#9040, ddev#9046, ddev#9061, ddev#9108, ddev#9115 and ddev#9121 also came out of this work. What's left is here.

## How This PR Solves The Issue

DDEV detects the provider through socktainer's `docker version` output (`IsAppleContainer()`). Every change below applies only on that provider.

- `ddev version`, `ddev utility dockercheck`, `ddev utility port-diagnose` and instrumentation report the provider as `apple-container`.
- `ddev start` and `ddev utility dockercheck` warn when socktainer is older than 1.6.1. Builds from source report no release version, so DDEV doesn't compare them.
- `ddev-ssh-agent` is always omitted, because web can't attach a volume another VM holds. With `ssh_agent_upstream` set, web bind-mounts that host socket directly, and Apple Container relays it into the VM. `host` uses `SSH_AUTH_SOCK`. `ddev auth ssh` explains this instead of adding keys to an agent web can't reach.
- `CopyIntoContainer` extracts with `tar` inside the container. socktainer 1.6.1 ignores a gzipped archive ([socktainer#484](socktainer/socktainer#484)) and drops each file's owner and mtime ([socktainer#514](socktainer/socktainer#514)). Both are fixed on socktainer `main` but not released.
- The mkcert CA archive leaves out its directory entry, which a never-started container refuses ([socktainer#502](socktainer/socktainer#502)).
- Project images build one service at a time. Concurrent image loads can leave a tag on its old image ([socktainer#518](socktainer/socktainer#518)), and Compose's bake build loads them all at once. Compose's concurrency limit doesn't reach the bake path, so DDEV calls `Build` once per service.
- Image pulls and `BuildPlatformToPull` use `linux/<arch>`, because socktainer's `/version` reports `Os: macOS` ([socktainer#517](socktainer/socktainer#517)).
- `host.docker.internal` is `host-gateway`, which socktainer resolves to the network gateway where the Mac answers.
- `FindContainersByVolume` matches `Mounts` itself, because socktainer ignores the `volume=` filter.
- Add-on installs get the same virtiofs propagation delay as Lima and Colima.
- Docs: an experimental Apple Container tab on the macOS Docker installation page, with setup, the Local Network prompt, SSH keys, limitations and a fix for a hanging `container system start`.

Mutagen works and is the default, as on any macOS provider.

Known limitations, each documented or named by a test skip:

- **Ports below 1024** can't be published. The router needs `ddev config global --router-http-port=8080 --router-https-port=8443`. The global setting matters: with 80/443 there, the router fails to bind even when the project sets 8080/8443.
- **Single-writer volumes:** add-on services that share a named volume with a running container fail to start. Apple closed [apple/container#1133](apple/container#1133) as working as designed.
- **Open socktainer issues:** [ddev#518](socktainer/socktainer#518), [ddev#519](socktainer/socktainer#519), [ddev#520](socktainer/socktainer#520), [ddev#517](socktainer/socktainer#517), [ddev#514](socktainer/socktainer#514), [ddev#510](socktainer/socktainer#510), [ddev#504](socktainer/socktainer#504), [ddev#499](socktainer/socktainer#499), [ddev#498](socktainer/socktainer#498), [ddev#497](socktainer/socktainer#497).
- **Unreleased socktainer fixes:** `main` has fixes for ddev#505, ddev#514, ddev#484 and ddev#498, the last still in PR [ddev#528](socktainer/socktainer#528). After the next release, a follow-up can raise `SocktainerMinVersion` and remove the matching skips and the `tar` workaround.
- socktainer 1.6.1 warns that it was built for Apple Container 1.6.1 when run with 1.7.1. The CI testbots run that pair, and it passes.

## Manual Testing Instructions

This needs macOS 26 on Apple silicon. The setup is in the new docs tab: https://ddev--8656.org.readthedocs.build/en/8656/users/install/docker-installation/

```bash
brew install socktainer docker docker-buildx
container system start
socktainer &
docker context use socktainer
ddev utility download-ddev --pr 8656
export PATH="$HOME/tmp/ddev-download-ddev/pr-8656:$PATH"
ddev config global --router-http-port=8080 --router-https-port=8443 --ssh-agent-upstream=host
mkdir -p ~/tmp/appletest && cd ~/tmp/appletest
echo '<?php echo gethostname();' > index.php
ddev config --project-type=php --docroot=.
ddev start -y
# Expect: macOS asks to allow container-runtime-linux on the local network the first time; click Allow
curl -s http://appletest.ddev.site:8080/
# Expect: appletest-web
ddev mutagen st -l | grep Status
# Expect: Status: Watching for changes
ddev exec ssh-add -l
# Expect: the keys that `ssh-add -l` lists on the host
ddev auth ssh
# Expect: an explanation that web uses the host's agent directly
ddev utility dockercheck
# Expect: socktainer version: 1.6.1
```

On another provider, run `ddev debug compose-config` in a project. Confirm that web still mounts `ddev-ssh-agent_socket_dir` and that `host.docker.internal` is unchanged.

## Automated Testing Overview

The Buildkite pipeline [macos-socktainer](https://buildkite.com/ddev/macos-socktainer) runs the suite with `DOCKER_TYPE=socktainer` and router ports 8080/8443. It runs on testbots with Apple Container 1.7.1 and socktainer 1.6.1. Build 40 passed on this branch before it was squashed.

- `TestAppleContainerSSHAgent` covers the host-agent mount. The `ddev-ssh-agent` tests skip there.
- Tests that hit a known socktainer or Apple Container gap skip on `IsAppleContainer()`, and each skip names its cause.
- `SkipUnlessDefaultEnvironment` still skips its tests there through its Mutagen check.

## Release/Deployment Notes

Apple Container support is experimental. The `macos-socktainer` pipeline builds only this branch, so its branch filter needs widening after merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dev#7372

`sanetestbot.sh` now runs `published-port-check.sh`, which publishes a port from a container and requests it from the host. When host port forwarding is broken, every HTTP test in the job fails with connection resets. The check fails the job early with one clear message instead. On socktainer it also looks for a pending macOS Local Network prompt for `container-runtime-linux` and names it.

`test.sh` uploads `~/tmp/socktainer.log` as a build artifact on socktainer runs, because it records DNS registrations and forwarder restarts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- `ddev utility port-diagnose` names the provider "Apple Container",
  matching the other display names.
- Drop the `apple-container` value of `ddev-environment`; it stays
  `darwin`, since `docker-platform` already reports Apple Container.
  `pkg/environment` no longer imports `dockerutil`.
- Set `host-gateway` inside the `IsAppleContainer()` case of
  `GetHostDockerInternal()` instead of in a second branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rfay
rfay force-pushed the 20260802_rfay_apple_container_experiment branch from 8db48c5 to 16eeab5 Compare November 25, 2026 16:28
@rfay

rfay commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

Did those, thanks!

@stasadev
stasadev self-requested a review November 25, 2026 17:09

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

I ran the manual checklist from the description on a MacBook Air with macOS 27.2.1, Apple Container 1.7.1 and socktainer 1.6.1, using the PR build v1.25.6-23-g16eeab51e. HTTP on 8080, HTTPS on 8443, Mutagen, ddev exec ssh-add -l with the host agent, ddev auth ssh and ddev utility dockercheck all worked, and web reached both the internet and host.docker.internal. Claude Code ran the same steps over SSH first and traced the failures below.

@rfay
rfay merged commit 035df89 into ddev:main Nov 25, 2026
39 of 44 checks passed
@rfay
rfay deleted the 20260802_rfay_apple_container_experiment branch November 25, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement

Projects

None yet

4 participants