Sign inSign up

waazaafr/docker-image-cloner

By waazaafr

•Updated 5 months ago

Clone images to personal registry.

Image
0

627

waazaafr/docker-image-cloner repository overview

⁠Docker Image Cloner

🐳 Mirror manager for Docker registries with web interface

⁠Description

Docker Image Cloner is an automatic synchronization tool that maintains a local mirror of your favorite Docker images. It monitors configured repositories and automatically synchronizes the most recent tags to your private registry.

⁠Key Features
  • šŸ”„ Schedulable automatic synchronization
  • šŸŽÆ Limitation to the N most recent tags (configurable)
  • 🌐 Web interface for management
  • šŸ“¦ Support for Docker Hub and private registries
  • šŸ” Namespace and specific tag management
  • šŸ“Š Real-time synchronization logs
  • šŸ’¾ Configuration persistence

⁠Environment Variables

VariableDefaultDescription
TARGET_REGISTRYregistry.example.comTarget Docker registry for synchronization
MAX_TAGS5Maximum number of recent tags to synchronize per image
SYNC_INTERVAL_HOURS6Interval between automatic synchronizations (in hours)
FLASK_PORT5000Web interface port
DATA_DIR/app/dataDirectory for data persistence
SECRET_KEY(auto)Flask secret key (automatically generated)

⁠Installation and Usage

services:
  docker-cloner:
    image: waazaafr/docker-image-cloner:latest
    container_name: docker-image-cloner
    restart: unless-stopped
    ports:
      - "5000:5000"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - $HOME/.docker/config.json:/root/.docker/config.json
      - ./data:/app/data
    environment:
      - TARGET_REGISTRY=registry.example.com
      - MAX_TAGS=5
      - SYNC_INTERVAL_HOURS=6
      - FLASK_PORT=5000

Starting:

docker compose up -d
⁠Docker Run
docker run -d \
  --name docker-image-cloner \
  -p 5000:5000 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v $HOME/.docker/config.json:/root/.docker/config.json \
  -v $(pwd)/data:/app/data \
  -e TARGET_REGISTRY=registry.example.com \
  -e MAX_TAGS=5 \
  -e SYNC_INTERVAL_HOURS=6 \
  waazaafr/docker-image-cloner:latest

⁠Web Interface Access

http://localhost:5000

⁠Synchronization Behavior

  • Images stored as: TARGET_REGISTRY/image-name:tag
  • Example: linuxserver/jellyfin → registry.example.com/jellyfin:latest
  • Only N most recent tags synchronized (MAX_TAGS)
  • Auto-sync every X hours (SYNC_INTERVAL_HOURS)
  • Manual sync via "šŸ”„ Synchronize" button
⁠Data Persistence

repositories.yaml in /app/data contains monitored repos + last update dates.

⁠Prerequisites

docker login registry.example.com

⁠Security āš ļø

  • Needs Docker socket access
  • Secure web interface with reverse proxy + auth
  • Use HTTPS for registry comms

⁠Logs

docker logs -f docker-image-cloner

⁠Troubleshooting

Docker daemon error:

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock alpine ls -la /var/run/docker.sock

Auth error:

docker login registry.example.com

⁠License

MIT License

⁠Author

waazaa


Made with ā¤ļø for Docker community

================================================================

Discord: https://discord.gg/p9xkjEw8ts⁠

Buy me coffee:

https://buymeacoffee.com/waazaa⁠

https://ko-fi.com/waazaa⁠

UnRAID: https://unraid.net/pricing?via=4c3f80⁠

Tag summary

Content type

Image

Digest

sha256:d9a929adf…

Size

60.7 MB

Last updated

5 months ago

docker pull waazaafr/docker-image-cloner