Code Monkey home page Code Monkey logo

gitolite-docker's Introduction

Gitolite for Raspberry Pi

Run

docker run -p 22022:22 -e SSH_KEY="$(cat ~/admin.pub)" -v $HOME/docker-data/git/repositories:/home/git/repositories -v $HOME/docker-data/git/ssh:/etc/ssh --restart=always --name gitolite <image_name>

SSH config

Add to ~/.ssh/config:

Host gitbox
    user git
    hostname dockera.local
    port 22022
    identityfile ~/.ssh/keyfile

Host gitadmin
    user git
    hostname dockera.local
    port 22022
    identityfile ~/.ssh/admin

Than to clone admin repo use git clone gitadmin:gitolite-admin or git clone gitbox:<repo> for other repositories.

Sources

Instructions

gitolite on docker

Runs an SSH server, serving gitolite as the git@ user.

On the first start, it will run "gitolite setup" with a starting ssh key you provided, or you can bootstrap with an existing gitolite-admin repository.

On subsequent starts, will run "gitolite setup" everytime to integrate any outside changes.

Examples

New installation:

docker run -e SSH_KEY="$(cat ~/.ssh/id_rsa.pub)" elsdoerfer/gitolite

Use an existing gitolite installation:

docker run -v /var/vcroot/git:/home/git/repositories elsdoerfer/gitolite

Environment variables:

SSH_KEY

SSH public key for initial access to the gitolite-admin repository. If you have an existing gitolite-admin repository, you may skip this.

GIT_CONFIG_KEYS LOCAL_CODE (example value: $ENV{HOME}/local)

These will be inserted into gitolite.rc.

TRUST_HOSTS

Hostnames (only a single one is supported currently) to add to known_hosts, i.e. github.com.

Directories you could bind mount (or use --volumes-from)

/home/git/repositories The actual git repositories will be stored here.

/etc/ssh The SSH host keys are stored here; they are generated when the container starts, and if you don't maintain them across containers, your clients will see warnings that they changed.

Mirroring

If your gitolite install needs to mirror (that is, execute git push itself), the image can help you:

  • The git user will have a ssh key generated for itself. Access the public key using docker cp CID:/home/git/.ssh/id_rsa.pub ..

    Note that if you keep recreating the container, rather than restarting, a new key will be generated. You can bind mount the /home/git/.ssh directory to remedy this.

  • Use the TRUST_HOSTS environment variable to prepare the ./known_hosts file.

Further customization

If you need to use things like custom hooks, you have different options:

  • Point the LOCAL_CODE variable to something like "$ENV{HOME}/.gitolite/local", use the gitolite-admin repo to provide the data.
  • You could bind mount files into the container (xxx: how to provide certain files (gitolite.rc) before setup runs?)
  • Derive a custom Docker image, ADD the files (xxx: how to provide certain files (gitolite.rc) before setup runs?)
  • Manually interact with a container, but lose it disposible nature.

gitolite-docker's People

Contributors

flatlining avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.