Home
ocid: Local-First, Peer-to-Peer OCI Image Distribution¶
ocid is a Radicle-style, local-first, peer-to-peer alternative to centralized OCI registries.
ocid (pronounced "oh-seed") lets you push, pull, and share container images directly between peers β no central registry required. Every node runs its own loopback OCI registry that standard tooling (podman, docker, oras) talks to unchanged, while peers exchange signed, content-addressed releases directly.
π Quick Start¶
1. Install ocid¶
1# From source (recommended)
2git clone https://github.com/safonas/ocid
3cd ocid
4just bin # Build binaries to ./bin/
5
6# Or via Homebrew (macOS/Linux)
7brew install safonas/tap/ocid
2. Start the Daemon¶
1ocid
This starts the daemon with: - OCI registry on 127.0.0.1:5050 - Embedded iroh endpoint (QUIC, hole-punching, relays) - Gossip and blob store for P2P distribution
3. Push an Image¶
1# Build and push an image to your local ocid registry
2podman build -t localhost:5050/myapp:1.0 .
3podman push localhost:5050/myapp:1.0
4. Share with a Peer¶
On Node A (publisher):
On Node B (consumer):
1# Connect to Node A using the ticket
2ocictl connect <ticket>
3
4# Follow Node A's releases
5ocictl follow <NodeA-PublisherId>
Now, Node B will automatically replicate all new releases from Node A!
π― Why ocid?¶
Problems with Centralized Registries¶
| Issue | Centralized Registries | ocid |
|---|---|---|
| Single point of failure | β Yes | β No (peer-to-peer) |
| Rate limits | β Yes | β No (no central authority) |
| Censorship | β Possible | β No (you control your data) |
| Privacy | β No (registry sees all) | β Yes (E2E encrypted) |
| Offline access | β No | β Yes (local-first) |
| Latency | β οΈ Depends on registry | β Low (LAN speeds) |
| Cost | β οΈ Paid tiers | β Free (your infrastructure) |
Use Cases¶
| Use Case | Description |
|---|---|
| Air-Gapped Environments | Distribute images without internet access. |
| CI/CD Pipelines | Share images between stages without pushing to a registry. |
| Local Development | Push/pull images between machines on your LAN. |
| Private Registries | Run your own registry without a central server. |
| Disaster Recovery | Replicate images across geographic locations. |
| Offline First | Work offline and sync when online. |
ποΈ Architecture¶
ocid is built on iroh, a Rust library for peer-to-peer networking with QUIC, hole-punching, and relays. The architecture is designed to be simple, secure, and efficient:
flowchart TB
subgraph host["Your Machine"]
podman["podman / docker / oras"] -->|HTTP /v2| registry["OCI Registry<br/>127.0.0.1:5050"]
ocictl["ocictl (CLI)"] -->|HTTP /_ocid| control["Control API"]
ocitop["ocitop (TUI)"] -->|SSE| control
end
registry --> daemon["ocid Daemon"]
control --> daemon
daemon --> gossip["iroh-gossip"]
daemon --> blobs["iroh-blobs"]
daemon --> endpoint["iroh Endpoint<br/>QUIC + NAT Traversal"]
endpoint <--> peer1["Peer 1"]
endpoint <--> peer2["Peer 2"]
%% Styling
classDef host fill:#e6f3ff,stroke:#333
classDef daemon fill:#fff2cc,stroke:#333
classDef p2p fill:#ffd966,stroke:#333
class podman,ocictl,ocitop,registry,control host
class daemon,gossip,blobs,endpoint daemon
class peer1,peer2 p2p Key Components¶
| Component | Purpose |
|---|---|
| OCI Registry | Embedded OCI v2 registry on 127.0.0.1:5050 |
| Control API | REST API for managing ocid (/_ocid/*) |
| iroh-gossip | Gossip protocol for announcements |
| iroh-blobs | Content-addressed blob store |
| iroh Endpoint | QUIC endpoint with NAT traversal |
π¦ Features¶
β Core Features¶
- OCI v2 Compatibility: Works with
podman,docker,oras,crane, etc. - Peer-to-Peer Distribution: Direct sync between peers using iroh.
- Signed Releases: Every release is signed with the publisherβs Ed25519 key.
- Content-Addressed Blobs: Blobs are addressed by SHA256 (OCI) and BLAKE3 (iroh).
- Retention Policies:
follow,seed,pinwithlast:N,full, ortagsmodes. - DNS Publisher Names: Use domain names (e.g.,
images.example.com) for publishers. - mDNS Discovery: Automatically discover other ocid nodes on your LAN.
- Relay Support: NAT traversal via iroh relays (optional).
- TLS Support: Self-signed certificates for transport encryption.
π§ Coming Soon¶
- Multi-key Publishers: Support for delegation (Radicle-style).
- Signed Tombstones: Propagated deletion (opt-in).
- Registry Authentication: Authenticate pushes (optional).
- Bandwidth Limits: Rate limiting for peers.
- IPv6 Support: Full IPv6 compatibility.
π Documentation¶
| Section | Description |
|---|---|
| Pitch | What ocid is and the topologies it serves |
| Architecture | High-level architecture and components |
| Data Model | Data structures and on-disk layout |
| Workflows | Publish, replicate, pull, and policy flows |
| Trust Model | Security and trust boundaries |
| DNS Publisher Names | Human-readable names for publishers |
| Development | Building, testing, and security scanning |
π€ Community¶
- GitHub: safonas/ocid
- Discussions: GitHub Discussions
- Issues: GitHub Issues
- Matrix:
#ocid:matrix.org(coming soon)
π License¶
ocid is licensed under the GPL-3.0-or-later license. See LICENSE for details.
π Acknowledgments¶
ocid stands on the shoulders of giants:
- iroh: Peer-to-peer networking with QUIC, hole-punching, and relays.
- Radicle: Inspiration for the local-first, peer-to-peer model.
- OCI Distribution Spec: Standard for container images.
- Rust: The programming language that makes ocid fast and safe.
New to ocid? Start with the README β the five-minute two-node demo!