01cfb2ede1c07d795b120a4df1c1feee63439477
Backend: - Add image fetch handler using go-containerregistry - Support HTTP/HTTPS and SOCKS5 proxy protocols - Pull images from remote registries (Docker Hub, etc.) - Store fetched images as blobs and manifests - Add timeout handling (60s for descriptor fetch) - Add detailed logging for pull progress - Add /api/v1/registry/image/fetch endpoint Frontend: - Add registry proxy configuration field - Add "获取镜像" button and dialog - Add proxy checkbox and input in fetch dialog - Add LinearProgress feedback during fetch - Add multi-stage Snackbar notifications - Auto-refresh image list after successful fetch - Fix download filename regex (remove trailing quote) - Adjust button colors for better UI consistency Dependencies: - Add github.com/google/go-containerregistry for OCI operations - Add golang.org/x/net/proxy for SOCKS5 support 🤖 Generated with [Qoder](https://qoder.com)
Cluster - OCI Registry
A lightweight OCI (Open Container Initiative) registry implementation written in Go using Fiber v3.
Features
- OCI Registry API v2 compliant
- Blob upload/download with chunked upload support
- Manifest handling (Docker and OCI formats)
- Tag management and catalog listing
- SQLite database for metadata storage
- File system storage for blobs and manifests
- RESTful API v1 for image management
Architecture
- main.go: Application entry point
- api/: API route definitions
- handler/: HTTP request handlers
- controller/: Business logic controllers
- internal/: Internal packages (config, database, middleware, model, rerr, storage)
Development
Backend (Go)
# Build
go mod tidy
go build -o cluster .
# Run
./cluster -debug -address 0.0.0.0:8080 -data-dir ./x-storage
# Or use Makefile
make build
make run
Frontend (React/TypeScript)
cd frontend
# Install dependencies (requires pnpm)
pnpm install
# Approve build scripts (required for esbuild)
pnpm approve-builds
# Development server
pnpm dev
# Build for production
pnpm run build
Note: This project uses pnpm as the package manager. Install it if needed:
npm install -g pnpm
# or
curl -fsSL https://get.pnpm.io/install.sh | sh -
API Endpoints
OCI Registry API v2
GET /v2/- Version checkPOST /v2/{repo}/blobs/uploads/- Start blob uploadPATCH /v2/{repo}/blobs/uploads/{uuid}- Upload blob chunkPUT /v2/{repo}/blobs/uploads/{uuid}?digest={digest}- Complete blob uploadGET /v2/{repo}/blobs/{digest}- Get blobHEAD /v2/{repo}/blobs/{digest}- Check blob existencePUT /v2/{repo}/manifests/{tag}- Put manifestGET /v2/{repo}/manifests/{tag}- Get manifestDELETE /v2/{repo}/manifests/{tag}- Delete manifestGET /v2/{repo}/tags/list- List tagsGET /v2/_catalog- List repositories
API v1
GET /api/v1/registry/image/list- List images
Configuration
-debug: Enable debug logging-address: Server address (default: 0.0.0.0:8080)-data-dir: Data directory for storage (default: ./x-storage)
License
[Add your license here]
Description
Languages
Go
67.5%
TypeScript
30.9%
Shell
0.8%
Dockerfile
0.5%
HTML
0.2%
Other
0.1%