Clone images to personal registry.
914
π³ Keep a mirror of your favorite Docker images in your own registry, managed from a web interface.
Add the images you want to follow, and Docker Image Cloner regularly copies their most recent tags to your private registry. Images are copied directly from registry to registry with craneβ : no Docker socket, no local pull, no disk space used on the host.
image:tag) to copy only that onelinux/amd64 and linux/arm64services:
docker-image-cloner:
image: waazaafr/docker-image-cloner:latest
container_name: docker-image-cloner
restart: unless-stopped
ports:
- "5000:5000"
volumes:
- ./data:/app/data
environment:
TARGET_REGISTRY: "registry.example.com"
TARGET_REGISTRY_USERNAME: "myuser"
TARGET_REGISTRY_PASSWORD: "mypassword"
MAX_TAGS: 5
SYNC_INTERVAL_HOURS: 6
docker run -d \
--name docker-image-cloner \
--restart unless-stopped \
-p 5000:5000 \
-v ./data:/app/data \
-e TARGET_REGISTRY="registry.example.com" \
-e TARGET_REGISTRY_USERNAME="myuser" \
-e TARGET_REGISTRY_PASSWORD="mypassword" \
-e MAX_TAGS=5 \
-e SYNC_INTERVAL_HOURS=6 \
waazaafr/docker-image-cloner:latest
Then open http://localhost:5000β , add the images to mirror, and click π Synchronize for a first sync.
| You add | What is copied |
|---|---|
linuxserver/jellyfin | The MAX_TAGS most recent tags from Docker Hub |
nginx | The MAX_TAGS most recent tags of the official image |
ghcr.io/owner/app | The MAX_TAGS most recent tags from that registry (see note below) |
linuxserver/jellyfin:10.10.7 | Only the 10.10.7 tag |
βΉοΈ For registries other than Docker Hub, tags are listed anonymously. Registries that require a token to list tags (
ghcr.io,quay.io, protected private registriesβ¦) fall back tolatestonly: add the tags you want explicitly (ghcr.io/owner/app:1.2).
Images are stored as TARGET_REGISTRY/<image name>:<tag>, without the namespace:
linuxserver/jellyfin:latest β registry.example.com/jellyfin:latestghcr.io/owner/app:1.2 β registry.example.com/app:1.2β οΈ Two images with the same name from different namespaces (e.g.
linuxserver/jellyfinandjellyfin/jellyfin) end up in the same repository in your registry. Mirror only one of them.
SYNC_INTERVAL_HOURS hours.| Variable | Default | Required | Description |
|---|---|---|---|
TARGET_REGISTRY | β | β | Your registry, where images are copied (e.g. registry.example.com) |
TARGET_REGISTRY_USERNAME | β | Username for the target registry | |
TARGET_REGISTRY_PASSWORD | β | Password or token for the target registry | |
SOURCE_REGISTRY_USERNAME | β | Username for private source registries (not used for Docker Hub) | |
SOURCE_REGISTRY_PASSWORD | β | Password or token for private source registries | |
MAX_TAGS | 5 | Number of most recent tags copied per image | |
SYNC_INTERVAL_HOURS | 6 | Interval between automatic synchronizations, in hours | |
CRANE_INSECURE | false | true to allow registries over plain HTTP or with self-signed certificates | |
FLASK_PORT | 5000 | Port of the web interface | |
DATA_DIR | /app/data | Directory where the list of images is stored |
Instead of the *_USERNAME / *_PASSWORD variables, you can reuse the credentials of the host (docker login) by mounting its Docker config file:
volumes:
- ./data:/app/data
- ~/.docker/config.json:/root/.docker/config.json:ro
This is also the way to authenticate on Docker Hub, to avoid its anonymous pull rate limits.
| Path | Content |
|---|---|
/app/data | repositories.yaml: the list of mirrored images |
| Port | Service |
|---|---|
5000 | Web interface |
β οΈ The web interface has no authentication. Do not expose it on the internet: keep it on your LAN, or put it behind a reverse proxy with authentication.
CRANE_INSECURE only for a trusted local registry.Logs of all synchronizations are available in the web interface and in the container logs:
docker logs -f docker-image-cloner
| Error | What to check |
|---|---|
auth failed / UNAUTHORIZED | The credentials of the registry, or the mounted config.json |
TOOMANYREQUESTS | Docker Hub rate limit: authenticate on Docker Hub (see above) |
x509: certificate / http: server gave HTTP response to HTTPS client | Your registry uses HTTP or a self-signed certificate: set CRANE_INSECURE=true |
MIT License β made with β€οΈ by waazaa for the Docker community.
Content type
Image
Digest
sha256:d9a929adfβ¦
Size
60.7 MB
Last updated
6 months ago
docker pull waazaafr/docker-image-cloner