TestcontainerEx.Connection.Strategies.AppleContainer (testcontainer_ex v0.6.0)

Copy Markdown View Source

Resolves the container engine host for Apple Container (https://github.com/apple/container).

Apple Container is a macOS-native container runtime for Apple silicon Macs. It uses the container CLI to manage containers via XPC rather than a traditional Docker-compatible HTTP API.

This strategy activates when:

  • The container binary is available on PATH
  • The Apple Container system service is running (container system status succeeds)

The strategy returns a special URL scheme apple-container:// that downstream code can use to route operations through the container CLI instead of the Docker HTTP API.

Configuration

No special configuration is required beyond having container installed and running on an Apple silicon Mac. The socket path used by the Apple Container API server is:

/var/run/com.apple.container.apiserver

Environment variables

  • CONTAINER_BIN — override the path to the container binary (default: searches PATH for container)