GitHub - flotwig/git-mirror-docker: Docker image for mirroring GitHub repos to GitLab/other Git remotes on a push webhook event from a GitHub repo. (original) (raw)

git-mirror-docker

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

Image Details

Sample docker run

This 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

Sample docker-compose.yml

⚠ Protip: You can even run this in the same docker-compose.yml as your gitlab-runner and gitlab-ce images.

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'

Notes