https://github.com/socktainer/socktainer
Docker-compatible REST API on top of Apple container
https://github.com/socktainer/socktainer
apple-container docker-api hacktoberfest swift
Last synced: about 2 months ago
JSON representation
Docker-compatible REST API on top of Apple container
- Host: GitHub
- URL: https://github.com/socktainer/socktainer
- Owner: socktainer
- License: apache-2.0
- Created: 2025-07-05T15:35:19.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2026-01-29T20:01:46.000Z (about 2 months ago)
- Last Synced: 2026-01-30T08:57:15.495Z (about 2 months ago)
- Topics: apple-container, docker-api, hacktoberfest, swift
- Language: Swift
- Homepage: https://socktainer.github.io/
- Size: 233 KB
- Stars: 136
- Watchers: 3
- Forks: 8
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - socktainer/socktainer - Docker-compatible REST API on top of Apple container (Swift)
README
# Socktainer π’
> [!IMPORTANT]
> Both `socktainer` and [Apple container](https://github.com/apple/container) are still under heavy development!
> [!NOTE]
> `socktainer` maintains to be compatible with [Docker Engine API v1.51](https://github.com/moby/moby/blob/v28.5.2/api/swagger.yaml).
>
> Progress is tracked in [#14](https://github.com/socktainer/socktainer/issues/14) and [#90](https://github.com/socktainer/socktainer/issues/90).
- [Socktainer π’](#socktainer-π’)
- [Quick Start β‘](#quick-start)
- [Launch socktainer π](#launch-socktainer-π)
- [Using Docker CLI π³](#using-docker-cli-π³)
- [Key Features β¨](#key-features)
- [Requirements π](#requirements-π)
- [Installation π οΈ](#installation-π οΈ)
- [Homebrew](#homebrew)
- [Stable Release](#stable-release)
- [Pre Release](#pre-release)
- [GitHub Releases](#github-releases)
- [Usage π](#usage-π)
- [Building from Source ποΈ](#building-from-source-ποΈ)
- [Prerequisites](#prerequisites)
- [Build & Run](#build-run)
- [Testing β
](#testing)
- [Contributing π€](#contributing-π€)
- [Workflow](#workflow)
- [Developer Notes π§βπ»](#developer-notes-π§βπ»)
- [Security & Limitations β οΈ](#security-limitations-οΈ)
- [Community π¬](#community-π¬)
- [License π](#license-π)
- [Acknowledgements π](#acknowledgements-π)
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**](https://github.com/benoitf/extension-apple-container) uses socktainer to visualize Apple containers/images in [Podman Desktop](https://podman-desktop.io/).
---
## Quick Start β‘
Get started with socktainer CLI in just a few commands:
### Launch socktainer π
```bash
./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`:
```bash
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:
```bash
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:
```shell
brew tap socktainer/tap
```
#### Stable Release
Install the official release:
```shell
brew install socktainer
```
#### Pre Release
Install development release:
```shell
brew install socktainer-next
```
### GitHub Releases
Download from socktainer [releases](https://github.com/socktainer/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)
```bash
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:
```bash
make
```
2. (Optional) Format the code:
```bash
make fmt
```
3. Run the debug binary:
```bash
.build/arm64-apple-macosx/debug/socktainer
```
> The server will create the socket at `$HOME/.socktainer/container.sock`.
### Testing β
Run unit tests:
```bash
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
---
## Community π¬
Join the Socktainer community to ask questions, share ideas, or get help:
- **Discord**: [discord.gg/Pw9VWKcUEt](https://discord.gg/Pw9VWKcUEt) β chat in real time with contributors and users
- **GitHub Discussions**: [socktainer/discussions](https://github.com/socktainer/socktainer/discussions) β ask questions or propose features
- **GitHub Issues**: [socktainer/issues](https://github.com/socktainer/socktainer/issues) β report bugs or request features
## 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 π³π»