Sign inSign up

schnell18/gitserver

By schnell18

•Updated almost 11 years ago

Git server based on Gitolite3 and cgit

Image
1

370

schnell18/gitserver repository overview

⁠Introduction

Dockerized gitolite, cgit and Apache to host massive Git repositories. The container is expected to mount host directory to store repositories, config and logs. The volume name in the container is /var/lib/gitolite3.

The image is based centos7. It runs a streamlined apache configuration on non-priviledged 8080 port. The gitolite-admin is accessible via HTTP. For production use, a reverse proxy such as nginx should be placed in front of the dockerized gitolite to handle HTTPS.

On first launch, the container creates gitolite-admin and testing repository on the host directory. And create the default gitolite admin account 'admin' with password same as login name. New user can be maintained by changing the file 'git_passwd' on the host directory mount on '/var/lib/gitolite3'.

Please refer to https://github.com/schnell18/dockerize/tree/master/gitserver⁠ for instructions to build the image and run the container.

⁠Run

Before you can run this image, you need setup a directory on host which is owned by specialized user 'git' with UID 888. Here is the command to create such directory:

# create user/group to run docker registry
os_group=git
os_user=git
getent group ${os_group} > /dev/null        \
  || sudo /usr/sbin/groupadd -g 888         \
                             -r ${os_group} \
                             2>/dev/null    \
  || :
getent passwd ${os_user} > /dev/null                \
  || sudo /usr/sbin/useradd -c "Owner of Git repos" \
                       -o                           \
                       -u 888                       \
                       -g ${os_group}               \
                       -s /bin/bash                 \
                       -r                           \
                       -d /var/lib/gitolite3        \
                       ${os_user} 2>/dev/null       \
  || :
# setup docker image storage diretories
sudo mkdir -p /var/lib/gitolite3
sudo chmod 755 /var/lib/gitolite3
sudo chown 888:888 /var/lib/gitolite3

You may replace '/var/lib/gitolite3' with any other directory you see fit.

Then you run the container like:

docker run                                   \
    -u git                                   \
    -p <HOST>:<PORT>:8080                    \
    -v /var/lib/gitolite3:/var/lib/gitolite3 \
    schnell18/gitserver

Tag summary

Content type

Image

Digest

sha256:a070a446f…

Size

133.5 MB

Last updated

almost 11 years ago

docker pull schnell18/gitserver