Skip to content

fix: capture output as written, and pull images as linux/arch (socktainer split-off) - #9108

Merged
rfay merged 4 commits into
ddev:mainfrom
rfay:20261112_rfay_capture_tz_platform_fixes
Nov 14, 2026
Merged

rfay merged 4 commits into
ddev:mainfrom
rfay:20261112_rfay_capture_tz_platform_fixes

Conversation

@rfay

@rfay rfay commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Short Summary (TL;DR)

Fixes a deadlock in DDEV's output capture, a TestTimezoneConfig failure that depends on test order, and image platform matching that trusted the daemon's reported OS. All three are general fixes found on the macOS socktainer pipeline, split out of #8656 so that PR is Apple-Container-only.

The Issue

These problems showed up on the experimental socktainer (Apple Container) Buildkite pipeline, but the first two can happen with any provider:

How This PR Solves The Issue

One commit per change:

Commit Change
fix(test): read captured output as it is written A new capturePipe starts reading at once, and all three capture functions use it.
test: read host zone before clearing TZ TestTimezoneConfig reads the host zone abbreviation before it clears TZ.
fix: match and pull DDEV images as linux/<arch>, not the daemon's OS DDEV images are Linux-only, so platform matching and the TestMain pull use linux/<arch>. Every supported Docker provider already reports linux.
refactor: build the omitted-container list in a new slice GetOmittedContainers used append on OmitContainersGlobal, which can write into the global list's spare capacity. It now uses slices.Concat.

Manual Testing Instructions

The test changes need only the tests:

make testpkg TESTARGS="-run 'TestCapture'"
# Expect TestCaptureUserOutLarge to pass in well under 30s

Automated Testing Overview

  • New TestCaptureUserOutLarge writes 512 KB to a captured UserOut. Claude Code ran it on macOS: it hung until its 30s limit on the old code and passes on the new.
  • Claude Code ran TestTimezoneConfig, TestImageExistsLocallyForPlatform, TestBuildPlatformToPull and TestPullImagesForPlatform on OrbStack, and they passed. On socktainer 1.6.1 it ran TestTimezoneConfig, TestImageExistsLocallyForPlatform, TestBuildPlatformToPull and TestFindServiceImages, which passed.
  • Nobody ran these on Linux or Windows; CI covers those.

Generated by Claude Code

@rfay
rfay requested a review from a team as a code owner November 12, 2026 15:59
@rfay rfay changed the title fix: capture output as written, and pull images as linux/<arch> fix: capture output as written, and pull images as linux/arch Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Download this PR's build for your OS and architecture with:

ddev utility download-ddev --pr 9108

Or download the artifact for your OS and architecture directly:

See Testing a PR.

Open in GitHub Codespaces

@rfay rfay changed the title fix: capture output as written, and pull images as linux/arch fix: capture output as written, and pull images as linux/arch (socktainer split-off) Nov 12, 2026
@rfay
rfay force-pushed the 20261112_rfay_capture_tz_platform_fixes branch from e941c6f to a7dd735 Compare November 12, 2026 17:49
@rfay
rfay requested a review from stasadev November 13, 2026 01:47
@rfay

rfay commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

@stasadev this is code that has already been proven in the socktainer branch but needed to come out of there to make that one easier to review, so should be OK. I'd like to get it in as soon as possible so the socktainer branch can get closer to reviewable, thanks!

rfay and others added 4 commits November 13, 2026 22:39
`util.CaptureUserOut`, `CaptureUserErr` and `CaptureStdOut` redirect output into a pipe, but they started reading the pipe only when the caller restored output. A write larger than the pipe buffer blocked forever, and the restore that would have read it never ran.

On the macos-socktainer pipeline, `TestTLSDiagnoseSmoke` blocked this way for 308 minutes, after about 570 bytes, until the 6h test timeout: https://buildkite.com/ddev/macos-socktainer/builds/24. A fresh pipe holds more than that, but macOS gives new pipes about 512 bytes when pipe memory runs short, which fits a testbot several hours into a run. That part is unconfirmed. The same test passes alone and passed in build 21.

All three functions now share `capturePipe`, which starts reading at once.

Claude Code ran the new `TestCaptureUserOutLarge` on macOS: it writes 512 KB to a captured `UserOut`, and it hung until its 30s limit on the old code and passes on the new. `TestCapture*`, `TestGetInput` and `TestGetQuotedInput` also pass. Nobody ran it on Linux or Windows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`TestTimezoneConfig` called `t.Setenv("TZ", "")` and then read `time.Local`. Go loads `time.Local` on first use, and an empty `TZ` makes it UTC. So when nothing earlier in the test process had used `time.Local`, the test expected `timezone=UTC` while the container correctly reported the host's zone. It failed this way every time on socktainer, and would fail on any provider when run first.

The test now reads the host zone abbreviation before it clears `TZ`.

Claude Code ran `TestTimezoneConfig` alone on socktainer 1.6.1, and it passed. A small Go program confirmed that `time.Local` is UTC after `TZ=""` when nothing used it before. It also passed on OrbStack, run alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`BuildPlatformToPull` compared build platforms with the daemon's `serverVersion.Os/Arch`, and the `pkg/dockerutil` TestMain pulled the web image for that platform. socktainer, the Docker API over Apple Container, reports `Os: "macOS"` though it runs Linux containers, so the TestMain pull asked for `darwin/arm64` and every `pkg/dockerutil` test failed, and `BuildPlatformToPull` never matched the daemon.

DDEV images are Linux-only, so both now use `linux/<arch>`. Every provider DDEV supports already reports `linux`, so nothing changes there. socktainer's report is socktainer/socktainer#517.

Claude Code ran `TestImageExistsLocallyForPlatform`, `TestBuildPlatformToPull` and `TestPullImagesForPlatform` on OrbStack and on socktainer 1.6.1, and they passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`GetOmittedContainers` appended the project's omitted containers to `app.OmitContainersGlobal`, which writes into the global list's backing array whenever it has spare capacity. `slices.Concat` always returns a new slice.

Claude Code ran `TestTimezoneConfig`, which starts a project, on OrbStack; nothing else exercises this beyond CI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rfay
rfay force-pushed the 20261112_rfay_capture_tz_platform_fixes branch from a7dd735 to 452371f Compare November 13, 2026 22:40

rfay commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

The split had dropped the TestMain half of the platform fix: containers_test.go got the comment but still pulled serverVersion.Os + "/" + serverVersion.Arch. That's now restored and the branch is rebased on main. The docs commit went away in the rebase since #9115 already landed it.

Claude Code ran TestCaptureUserOutLarge on the old capture code (hangs to its 30s limit) and on this branch (passes). Before the rebase it also ran the pkg/dockerutil image tests and TestTimezoneConfig on Docker 29 on Linux, which passed. The host is UTC, so the timezone bug itself couldn't show there.

🤖 Reviewed with assistance from Claude Code


Generated by Claude Code

@rfay
rfay merged commit 5814274 into ddev:main Nov 14, 2026
43 checks passed
@rfay
rfay deleted the 20261112_rfay_capture_tz_platform_fixes branch November 14, 2026 04:34
rfay added a commit to rfay/ddev that referenced this pull request Nov 14, 2026
…dev#7372

HANDOFF now records builds 27 and 28 of the socktainer pipeline. The xhgui failure is socktainer registering container names after the process starts (socktainer#519, with ddev#9121 as the DDEV fix). The diagnose failure isn't reproduced and now prints dockercheck's output. It also records socktainer#520 and the socktainer log artifact.

The split-off section is replaced: ddev#9108 merged and its commits left the branch on rebase. The two diagnose commits are listed as candidates for the next split-off. The upstream open list and the local machine state are current as of 2026-11-13.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
rfay added a commit to rfay/ddev that referenced this pull request Nov 17, 2026
…dev#7372

HANDOFF now records builds 27 and 28 of the socktainer pipeline. The xhgui failure is socktainer registering container names after the process starts (socktainer#519, with ddev#9121 as the DDEV fix). The diagnose failure isn't reproduced and now prints dockercheck's output. It also records socktainer#520 and the socktainer log artifact.

The split-off section is replaced: ddev#9108 merged and its commits left the branch on rebase. The two diagnose commits are listed as candidates for the next split-off. The upstream open list and the local machine state are current as of 2026-11-13.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
rfay added a commit to rfay/ddev that referenced this pull request Nov 18, 2026
…dev#7372

HANDOFF now records builds 27 and 28 of the socktainer pipeline. The xhgui failure is socktainer registering container names after the process starts (socktainer#519, with ddev#9121 as the DDEV fix). The diagnose failure isn't reproduced and now prints dockercheck's output. It also records socktainer#520 and the socktainer log artifact.

The split-off section is replaced: ddev#9108 merged and its commits left the branch on rebase. The two diagnose commits are listed as candidates for the next split-off. The upstream open list and the local machine state are current as of 2026-11-13.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
rfay added a commit to rfay/ddev that referenced this pull request Nov 23, 2026
…#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]>
rfay added a commit to rfay/ddev that referenced this pull request Nov 24, 2026
…#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]>
rfay added a commit to rfay/ddev that referenced this pull request Nov 25, 2026
…#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]>
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.

1 participant