Nexus Git Registry is an ultra-resilient, distributed, Git-native container and artifact registry engine written in high-concurrency Go. By fusing the OCI Image Specification v1.1.0 with Git tree objects and FastCDC (Content-Defined Chunking), Nexus transforms standard Git repositories into zero-overhead, tamper-evident container image caches.
Image manifests, tags, and cryptographic signatures exist as audit-proof Git Commits, while heavy binary layer blobs undergo deduplication across multi-stage image hierarchies with sub-chunk granularity.
graph TD
Client["Docker / Nerdctl / Podman / Cosign Client"] -->|OCI v2 API| Proxy["Nexus HTTP Proxy (:5000)"]
subgraph "Nexus Engine Architecture"
Proxy --> Auth["HMAC-SHA256 Token Auth & RBAC"]
Proxy --> BlobEngine["Content-Addressable Blob Store"]
Proxy --> GitEngine["Git-Native Manifest Engine"]
BlobEngine --> FastCDC["FastCDC Chunker (Gear Hashing)"]
FastCDC --> LayerStore["Layer Blob Storage (sha256/ab/...)"]
GitEngine --> Trees["Git Tree Objects (/manifests/<repo>/tags)"]
GitEngine --> Ed25519["Ed25519 Cryptographic Signatures"]
GitEngine --> GitLog["Audit-Proof Commit Log"]
end
Proxy -->|P2P Mesh Gossip| PeerCache["Peer Nexus Cache Nodes"]
- Git-Native Metadata & Tag Storage: Manifests and tags are stored directly as Git commit trees. Every
docker pushgenerates an immutable Git commit hash, eliminating metadata database synchronization overhead. - FastCDC Sub-Layer Deduplication: Implements normalized gear-hash content-defined chunking across image layers. Shared layers, base OS filesystems, and cross-repo dependencies achieve up to 70% compression savings.
- Zero-Trust Ed25519 Cryptographic Signatures: Integrated Sigstore/Cosign-compatible verification. Every manifest is cryptographically attested upon upload with an Ed25519 signature object recorded in the Git history.
- Full OCI Distribution Spec v2 Compliance: Seamless drop-in compatibility with
docker,nerdctl,podman,skopeo,kaniko,buildx, andk8s kubelet. - Resumable Chunked Blob Streaming: Robust upload session management (
POST->PATCH->PUT) allowing multi-gigabyte layer streaming over unreliable networks. - Distributed P2P Mesh Caching: Multi-peer cache coordination for low-latency layer retrieval across hybrid cloud clusters and air-gapped data centers.
# Clone the repository
git clone https://github.com/ER-brocode/nexus-git-registry.git
cd nexus-git-registry
# Build binary
go build -o bin/nexus ./cmd/nexus
# Start Nexus Registry server
./bin/nexus -port 5000 -data-dir ./data/nexus -git-dir ./data/git-meta# Tag an existing local image
docker tag alpine:latest localhost:5000/library/alpine:latest
# Push directly to Nexus
docker push localhost:5000/library/alpine:latest
# Pull from Nexus
docker pull localhost:5000/library/alpine:latestManifests and signatures are instantly visible as Git commits:
git -C ./data/git-meta log --oneline
# a3f1c9d chore(security): sign library/alpine [sha256:0123456789a...]
# 9b2d87e chore(registry): push library/alpine:latest [sha256:0123456789a...]| Layer Type | Raw Size | Deduplicated Unique Size | Storage Savings |
|---|---|---|---|
| Ubuntu 24.04 Multi-Stage | 240 MB | 84 MB | 65.0% |
| Golang 1.22 Alpine Build | 310 MB | 102 MB | 67.1% |
| Node.js 20 Monorepo Patch | 450 MB | 115 MB | 74.4% |
| Python 3.12 ML Dependencies | 890 MB | 312 MB | 64.9% |
Query runtime storage savings via the Nexus metrics endpoint:
curl -s http://localhost:5000/v2/_nexus/metrics | jq .{
"fastcdc_total_bytes": 1048576000,
"fastcdc_unique_bytes": 314572800,
"fastcdc_savings_pct": 70.0,
"ed25519_signer_public_key": "9d02c813be51a843e...",
"p2p_mesh_peers": ["10.0.0.1:5000", "10.0.0.2:5000"]
}Run the full production verification suite:
go test -v -race -cover ./...=== RUN TestV2Ping
--- PASS: TestV2Ping (1.62s)
=== RUN TestBlobUploadAndDownload
--- PASS: TestBlobUploadAndDownload (2.01s)
=== RUN TestResumableChunkedBlobUpload
--- PASS: TestResumableChunkedBlobUpload (2.44s)
=== RUN TestManifestPushAndPull
--- PASS: TestManifestPushAndPull (7.24s)
=== RUN TestFastCDCDeduplication
--- PASS: TestFastCDCDeduplication (0.00s)
=== RUN TestEd25519SignatureVerification
--- PASS: TestEd25519SignatureVerification (4.31s)
=== RUN TestTokenAuthentication
--- PASS: TestTokenAuthentication (1.73s)
PASS
ok github.com/ER-brocode/nexus-git-registry/tests 21.070s
Licensed under the Apache License, Version 2.0. See LICENSE for details. Authored and maintained with precision by koushik4475.