Create and sync remote git mirrors (GitHub, Gitea, etc.)
499
For mirroring private repository you should mount a directory with id_rsa and id_rsa.pub files to the /root/ssh folder inside a container.
docker run \
-e [email protected]:yuri-karpovich/test.git \
-e REPO_DIR_NAME=test \
-e INTERVAL=600 \
-v /your/local/folder:/repos \
-v /you/ssh_keys/folder:/root/ssh \
-it spoonest/git_mirroring:latest
where
-e [email protected]:yuri-karpovich/test.git - SSH URL for repo cloning
-e REPO_DIR_NAME=test - folder name in /repos folder where specified repo will be cloned
-e INTERVAL=600 - sync interval in seconds
-v /your/local/folder:/repos - mont local folder where mirrors will be saved
-v /you/ssh_keys/folder:/root/ssh - for mirroring private repository you should mount a directory with id_rsa and id_rsa.pub files to the /root/ssh folder inside a container.
version: "3"
services:
test_repo:
image: spoonest/git_mirroring:latest
environment:
REPO_URL: [email protected]:yuri-karpovich/test.git
REPO_DIR_NAME: test
INTERVAL: 600
volumes:
- /your/local/folder:/repos
- /you/ssh_keys/folder:/root/ssh
docker run \
-e REPO_URL=https://github.com/yuri-karpovich/test.git \
-e REPO_DIR_NAME=test \
-e INTERVAL=600 \
-v /your/local/folder:/repos \
-it spoonest/git_mirroring:latest
where
-e REPO_URL=https://github.com/yuri-karpovich/test.git - HTTPS URL for repo cloning
-e REPO_DIR_NAME=test - folder name in /repos folder where specified repo will be cloned
-e INTERVAL=600 - sync interval in seconds
-v /your/local/folder:/repos - mont local folder where mirrors will be saved
version: "3"
services:
test_repo:
image: spoonest/git_mirroring:latest
environment:
REPO_URL: https://github.com/yuri-karpovich/test.git
REPO_DIR_NAME: test
INTERVAL: 600
volumes:
- /your/local/folder:/repos
This image use the following ssh_config
Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
Set env FIRST_PULL_INTERVAL in seconds
Run container with parameters --entrypoint=/bin/sh:
docker run --entrypoint=/bin/sh \
-e [email protected]:yuri-karpovich/test.git \
-e REPO_DIR_NAME=test \
-e INTERVAL=600 \
-v /your/local/folder:/repos \
-v /you/ssh_keys/folder:/root/ssh \
-it spoonest/git_mirroring:latest
Content type
Image
Digest
Size
14.8 MB
Last updated
almost 6 years ago
docker pull spoonest/git_mirroring