Public Repository

Last pushed: 7 months ago
Short Description
Mirrors Git repositories
Full Description

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:PASSWORD@gitlab.example.com/mirrors means that if a webhook for
    https://gitmirror.example.com/foo.git is mirrored to
    https://USER:PASSWORD@gitlab.example.com/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:PASSWORD@gitlab.example.com/mirrors/stackage-server.git master prod
      stack.git https://github.com/commercialhaskell/stack.git https://USER:PASSWORD@gitlab.example.com/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.

Docker Pull Command
Owner
fpco

Comments (0)