# docker-for-apple-container

> Stateless `docker` command wrapper for Apple's `container` CLI on macOS.
> Run the Docker commands your tools already expect, without Docker Desktop, Podman, or any third-party adapter.

docker-for-apple-container is a stateless translator: it maps each supported `docker` command to a clean Apple `container` equivalent and fails loudly on the rest. Apple `container` is the single source of truth, so the shim persists nothing of its own (no sidecar file, registry, or database). Even `docker compose` stays stateless: project membership is stored as labels in Apple's own object store, exactly as Docker Compose does.

Compose forwards `dns`, `dns_search`, and `dns_opt` to Apple. Service-name
injection is network-scoped: on multi-network stacks, each container receives
the peer address from the first network they share.

Successful non-attached `docker start` operations reconstruct any affected
Compose projects from runtime labels and refresh `/etc/hosts` across their
running members using current network addresses. Bare `docker restart` remains
Apple's `stop` plus `start` and uses the same refresh. Failures warn without
overriding a successful lifecycle result, and no shim-owned state is persisted.
Attached or interactive starts remain direct Apple passthroughs.

Compose supports up, down, ps, logs, build, pull, exec, start, stop, restart,
rm, config, and ls. Runtime membership comes only from Compose labels stored by
Apple. Start order is dependency-forward when a file is available; stop and
remove are reverse; label-only operation falls back to stable service-name
order. Pull requires the file, while exec and lifecycle verbs can work from
labels alone. The shim supports exactly one container per service and rejects
scaled runtime state instead of selecting a replica arbitrarily.
Compose run, scaling, health-gated dependencies, network aliases, extra_hosts,
and anonymous-volume removal remain deferred and are never approximated.

## Runtime compatibility

- Requires macOS 26 with Apple `container` 1.2.0 or newer.
- The current compatibility baseline is Apple `container` 1.2.0.
- Apple's Containerization Swift package is bundled by Apple as part of
  `container`; it is not a direct shim dependency or a separate installation.

## Inspect formatting

`docker inspect` and `docker container inspect` share one Docker-shaped object.
The `-f`/`--format` implementation supports field paths, literal text, multiple
expressions, and `json` rendering. It intentionally refuses unsupported fields
and full Go-template control flow rather than approximating them.

Container presentation is derived live from Apple's list and inspect JSON.
Inspect includes process configuration, mounts, published ports, resource and
DNS settings, selected security settings, and network attachments. `docker ps`
provides Docker-shaped columns, JSON lines, bounded templates, and stateless
`ancestor`, `network`, and `volume` filters. `docker port` reads published-port
bindings from the same runtime object.

Lifecycle flags map directly where Apple 1.2 exposes the same behavior:
`docker exec` supports detach, user, environment files, interactive/TTY, and
working-directory flags; `docker start` supports attach and interactive; and
`docker stop` supports timeout and signal selection. `docker system df` forwards
Apple's Docker-shaped disk report, while `docker container prune -f` invokes
Apple's already non-interactive stopped-container prune. Unsupported prune
filters fail explicitly.

`docker system info` aliases the translated `docker info` presentation.

`docker image inspect` uses the same formatter and returns Docker-shaped image
metadata. `docker images` and `docker image ls` render Docker columns, quiet
IDs, digest/no-truncation output, JSON lines, or the supported image fields.

## Links

- [Landing page (this site)](https://appautomaton.github.io/docker-for-apple-container/): overview, install steps, FAQ, command-tier table.
- [README (canonical, source-of-truth)](https://github.com/appautomaton/docker-for-apple-container/blob/main/README.md): full command contract, compose design, caveats.
- [GitHub repository](https://github.com/appautomaton/docker-for-apple-container)
- [Homebrew tap](https://github.com/appautomaton/homebrew-tap): `brew install appautomaton/tap/docker-for-apple-container`
- [PyPI package](https://pypi.org/project/docker-for-apple-container/): `uv tool install docker-for-apple-container`
- [Releases](https://github.com/appautomaton/docker-for-apple-container/releases)
- [LICENSE (MIT)](https://github.com/appautomaton/docker-for-apple-container/blob/main/LICENSE)

## Optional

- Sitemap: /sitemap.xml
- robots.txt explicitly allow-lists GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-Web, PerplexityBot, Google-Extended, CCBot, anthropic-ai, Applebot.
