Cloner is a simple Docker container, built on Go, to easily clone a git repo into a Docker Volume on a regular basis. This lets you easily mount a git repo into a container, in a way that will auto-update, for deployments with systems like Docker Compose and Portainer.
You can pull the container like any other Docker Container:
docker pull ghcr.io/homelabian/clonerYou can run the container with very little info, the only requirement is you supply a repo URL to clone.
docker run -e CLONER_1_REPO=https://github.com/homelabian/cloner -v clonervol:/job-1 ghcr.io/homelabian/clonerThis will clone the Cloner repo to your volume clonervol, and will clone again everyday at midnight.
Cloner can run any number of jobs, this is done by numbering the environment variables. Each job can have the following settings:
| Variable | Use |
|---|---|
| Cron | The cron string to represent running the clone again. |
| RepoAuth | Enable or disable auth login when cloning |
| Repo | The repo to clone |
| RepoUser | The username to use when using Auth |
| RepoPass | The password to use when using Auth |
| Output | The directory to clone to |
Each time a job will run through a few steps when cloning:
- Delete the existing clone
- Clone the repo to the output folder
For this reason, Cloner doesn't support cloning to the root of a volume, but we are looking for ways to acomplish this.
By default, a job will refresh daily at midnight to an output folder called /job-<NUM>/output, and will do so with not authentication. Therefore, you only NEED to provide the Repo you want to clone.
The format for a Environment Variable is quite simple:
CLONER_<NUM>_<OPTION>=<VALUE>
Where <NUM> is the Job Number, <OPTION> is the Job Variable from the above table, in all caps. Finally, <VALUE> is the value you want to set the environment variable to.
version: '3.8'
services:
cloner:
image: ghcr.io/homelabian/cloner
environment:
- CLONER_1_REPO=https://github.com/homelabian/cloner
- CLONER_1_CRON="0 0 0 * * *"
- CLONER_1_OUTPUT=/data/cloner
volumes:
- data:/data
volumes:
data:Cloner is open to anyone who wants to expand on it and contribute! Simeply Fork, Change, Commit, PR!
Homelabian is commited to providing a safe open-source space, as such Homelabian will endevour to moderate any contributor environments to meet everyones needs. This may mean we need to update our rules from time to time to refelect issues we are facing in our communities.
TLDR; Be nice, don't make people feel uncomfortable and be supportive in all communications.

