Image for mirroring GitHub repos to GitLab/other Git remotes on a push webhook event from GitHub.
305
This is a Docker image based on git-mirror, for mirroring GitHub repos to GitLab/other Git remotes on a push webhook event from a GitHub repo.
Want to mirror GitLab CI status checks back to the original GitHub commits? Check out
gitlab-ci-github-status-checks, also fully Dockerized.
Docker Hub: https://hub.docker.com/r/flotwig/git-mirror
$WEBHOOK_PATHid_rsa) to the /root/.ssh/id_rsa volume$GIT_HOST - the host:port of the Git host to mirror to$WEBHOOK_PATH - the path to expose the webhook on, ex /.gh-webhook$WEBHOOK_SECRET - a secret string entered in the GitHub webhook configuration, used to authenticate webhook requestsdocker runThis sets up the webhook at http://0.0.0.0:12345/.gh-webhook.
docker run -p 12345:80 \
--restart=always \
-v /your/github/and/GIT_HOST/privkey:/root/.ssh/id_rsa \
-e GIT_HOST=gitlab \
-e WEBHOOK_PATH=/.gh-webhook \
-e WEBHOOK_SECRET=your-github-webhook-pre-shared-secret \
flotwig/git-mirror:latest
docker-compose.yml⚠ Protip: You can even run this in the same
docker-compose.ymlas yourgitlab-runnerandgitlab-ceimages.
This sets up the webhook at http://0.0.0.0:12345/.gh-webhook.
mirror:
image: 'flotwig/git-mirror:latest'
restart: always
ports:
- '12345:80'
environment:
- GIT_HOST=gitlab
- WEBHOOK_PATH=/.gh-webhook
- WEBHOOK_SECRET=your-github-webhook-pre-shared-secret
volumes:
- '/your/github/and/GIT_HOST/privkey:/root/.ssh/id_rsa'
owner/repo folder pattern is kept when pushing to the new $GIT_HOST, so ensure that you have the correct repositories set up before you start sending webhook events.known_host verification is DISABLED by default, since there can be no user interaction. Make sure you are only connecting via trusted networks.
/root/.ssh/config volume, and pass in your desired known_hosts configuration as /root/.ssh/known_hostsContent type
Image
Digest
Size
301.6 MB
Last updated
almost 7 years ago
docker pull flotwig/git-mirror