Sign inSign up

fpco/gitmirror

By fpco

Updated over 9 years ago

Mirrors Git repositories

Image
0

1.6K

fpco/gitmirror repository overview

fpco/gitmirror

This image uses dustin/gitmirror to mirror git repositories from one place to another (e.g. from public Github to a private Gitlab instance). It will listen for webhook requests to trigger updating the mirror.

Listens on port 8124 for webhook requests, where the path must match the repo name. E.g. curl http://localhost:8124/stackage-server.git.

Environment variables
  • DEFAULT_MIRROR_PREFIX: Default prefix for location to mirror repositories triggered by a Github webhook (unless overridden in MIRRORS below). For example, https://USER:[email protected]/mirrors means that if a webhook for https://gitmirror.example.com/foo.git is mirrored to https://USER:[email protected]/mirrors/foo.git.

  • DEFAULT_MIRROR_PUSH_ARGS: Default arguments to pass to git push when pushing the mirror. Default is --mirror, but you might want to override this to (a) specific branch name(s).

  • MIRRORS: List of repositories to mirror and their destinations. Each line is one repository, and has the format NAME.git ORIGIN_URL GIT_PUSH_ARGS. For example, this mirrors the master and prod branches of stackage-server, and all branches of stack:

      stackage-server.git https://github.com/fpco/stackage-server.git https://USER:[email protected]/mirrors/stackage-server.git master prod
      stack.git https://github.com/commercialhaskell/stack.git https://USER:[email protected]/mirrors/stack.git --mirror
    
  • GITMIRROR_SECRET: Secret token required for Github webhooks (see Github's documentation). If omitted or blank, no secret token is required.

  • GITMIRROR_DIR: Directory to store the mirrors. Defaults to /gitmirror. You may wish to volume mount this so that restarting the container doesn't require the repos to be re-cloned.

Tag summary

Content type

Image

Digest

Size

251.4 MB

Last updated

over 9 years ago

docker pull fpco/gitmirror