Skip to content

socktainer/socktainer

Repository files navigation

Socktainer 🚒

Important

Both socktainer and Apple container are still under heavy development!

Note

socktainer maintains to be compatible with Docker Engine API v1.51.

Progress is tracked in #14 and #90.

Socktainer is a CLI/daemon that exposes a Docker-compatible REST API on top of Apple's containerization libraries πŸπŸ“¦.

It allows common Docker clients (like the Docker CLI) to interact with local containers on macOS using the Docker API surface πŸ³πŸ’».

Podman Desktop Apple Container extension uses socktainer to visualize Apple containers/images in Podman Desktop.


Quick Start ⚑

Get started with socktainer CLI in just a few commands:

Launch socktainer 🏁

./socktainer
FolderWatcher] Started watching $HOME/Library/Application Support/com.apple.container
[ NOTICE ] Server started on http+unix: $HOME/.socktainer/container.sock
...

Using Docker CLI 🐳

Export the socket path as DOCKER_HOST:

export DOCKER_HOST=unix://$HOME/.socktainer/container.sock
docker ps        # List running containers
docker ps -a     # List all containers
docker images    # List available images

Or inline without exporting:

DOCKER_HOST=unix://$HOME/.socktainer/container.sock docker ps
DOCKER_HOST=unix://$HOME/.socktainer/container.sock docker images

Key Features ✨

  • Built on Apple’s Container Framework 🍏
  • Provides Docker REST API compatibility πŸ”„ (partial)
  • Listens on a Unix domain socket $HOME/.socktainer/container.sock
  • Supports container lifecycle operations: inspect, stop, remove πŸ› οΈ
  • Supports image listing, pulling, deletion, logs, health checks. Exec without interactive mode πŸ“„
  • Broadcasts container events for client liveness monitoring πŸ“‘

Requirements πŸ“‹

  • macOS 26 (Tahoe) on Apple Silicon (arm64) Apple’s container APIs only work on arm64 Macs πŸπŸ’»
  • Apple Container 0.6.0

Installation πŸ› οΈ

Homebrew

socktainer is shipped via a homebrew tap:

brew tap socktainer/tap

Stable Release

Install the official release:

brew install socktainer

Pre Release

Install development release:

brew install socktainer-next

GitHub Releases

Download from socktainer releases page the zip or binary. Ensure the binary has execute permissions (+x) before running it.


Usage πŸš€

Refer to Quick Start above for immediate usage examples.


Building from Source πŸ—οΈ

Prerequisites

  • Swift 6.2 (requirements from Apple container)
  • Xcode 26 (select the correct toolchain if installed in a custom location)
sudo xcode-select --switch /Applications/Xcode_26.0.0.app/Contents/Developer
# or
sudo xcode-select -s /Applications/Xcode-26.app/Contents/Developer

Build & Run

  1. Build the project:
make
  1. (Optional) Format the code:
make fmt
  1. Run the debug binary:
.build/arm64-apple-macosx/debug/socktainer

The server will create the socket at $HOME/.socktainer/container.sock.

Testing βœ…

Run unit tests:

make test

Contributing 🀝

We welcome contributions!

Workflow

  1. Fork the repository and create a feature branch 🌿
  2. Open a PR against main with a clear description πŸ“
  3. Add or update tests for new behavior (see Tests/socktainerTests) βœ”οΈ
  4. Keep changes small and focused. Document API or behavioral changes in the PR description πŸ“š

Developer Notes πŸ§‘β€πŸ’»

  • Code organization under Sources/socktainer/:
    • Routes/ β€” Route handlers πŸ›£οΈ
    • Clients/ β€” Client integrations πŸ”Œ
    • Utilities/ β€” Helper utilities 🧰
  • Document any public API or CLI changes in this README πŸ“

Security & Limitations ⚠️

  • Intended for local development and experimentation 🏠
  • Running third-party container workloads carries inherent risks. Review sandboxing and container configurations πŸ”’
  • Docker API compatibility is partial, focused on commonly used endpoints. See Sources/socktainer/Routes/ for implemented routes
  • Private registry auth currently depends on Apple container behavior. If login succeeds but private pulls/builds still fail, a manual workaround may be required. See apple/container#816 comment 3534438608 and comment 3503618765.

Community πŸ’¬

Join the Socktainer community to ask questions, share ideas, or get help:

License πŸ“„

See the LICENSE file in the repository root.


Acknowledgements πŸ™

  • Built using Apple containerization libraries 🍏
  • Enables Docker CLI and other Docker clients to interact with local macOS containers πŸ³πŸ’»

About

Docker-compatible REST API on top of Apple container

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages