To clone locally: $ git clone https://betagit.vosjedev.net/git/gitolite-cgit-docker.git
48428d2e0249 Upgrade alpine linux to latest version[checkout]
| Name | Size | Mode |
|---|---|---|
| .gitea/ | - | 040000 |
| .gitignore | 17B | 100644 |
| LICENSE | 34.33KiB | 100644 |
| README.md | 6.49KiB | 100644 |
| bootstrap.sh | 286B | 100644 |
| config.env.example | 265B | 100644 |
| docker-compose.yml | 254B | 100644 |
| gitolite-cgit/ | - | 040000 |
| img/ | - | 040000 |
gitolite-cgit based on alpine image¶
Fork of heckyel's image
Changes made by the fork:
- don't generate /etc/cgitrc if it already exists (for example when mounting the cgitrc)
- don't start git-daemon (I don't use it)
- edit style.css to use orange as accept colour
- use cgit fork @ https://git.vosjedev.net/cgit/
Below follows the original unmodified readme. Know that to use this fork, below instructions do not apply.
What is this image?¶
rusian/gitolite-cgit is a Docker image with cgit in dark-mode and gitolite running on top of alpine base image.
Usage¶
- Pull the image
| - | |
|---|---|
- Run the image with provided environment:
| - | |
|---|---|
Environment¶
SSH_KEY: Public key of gitolite adminSSH_KEY_NAME: Name of gitolite adminCGIT_CLONE_PREFIX: cgit clone prefix to display on each repository. For example:https://git.example.com, the clone URL should be:ssh://git@example.comCGIT_ROOT_TITLE: Text printed as heading on the repository index page. Default value: "Git Repository Browser".CGIT_DESC: Add description to cgitCGIT_SNAPSHOT: Snapshot tarball.
Exposed ports¶
- Port 22: for SSH clone
- Port 80: for cgit webpage running on Nginx
- Port 9418: for git daemon protocol
Volume¶
/var/lib/git: gitolite home folder, store all repositories likegitolite-admin/etc/ssh/: store all generated SSH server key
How to interact with git server¶
Cgit webpage: http://<server_ip>/
Supported clone method:
-
SSH: authentication with gitolite configuration inside
gitolite-admin.
For more information, please refer to basic administration.- -
HTTP:
enable-http-clone=1by default, which let cgit act as a dumb HTTP enpoint for git clones.
You can disable that by edit /etc/cgitrc. I may consider to add more feature, so you can set config
fromdocker runordocker-compose.yml.git pushis not supported via HTTP.- -
GIT:
git daemonis enabled by default withupload-packservice
(this serves git fetch-pack and git ls-remote clients), allowing anonymous
fetch, clone.-
Docker-compose¶
- Pull the image:
| - | |
|---|---|
- Create environment file
I create gitolite admin with the host public key and username.
In case, you are running this on server, you need to enter
SSH_KEY and SSH_KEY_NAME into config.env:
| - | |
|---|---|
For convience, I create a bootstrap.sh script for user who use public
key and name from the host running Docker:
| - | |
|---|---|
Generate public key and private key:
| - | |
|---|---|
- Create
docker-compose.yml:
| - | |
|---|---|
Then power-on your container:
| - | |
|---|---|
Customize cgit configuration¶
As there are many cgit configuration, you can create cgitrc configure and map to /etc/cgitrc
Modify the docker-compose.yml:
| - | |
|---|---|
Build docker image¶
| - | |
|---|---|
| - | |
|---|---|
| - | |
|---|---|
Extra¶
Example of gitolite-admin/conf/gitolite.conf:
Set default branch¶
| - | |
|---|---|
Real sample:
| - | |
|---|---|
Delete branch¶
| - | |
|---|---|
Real sample:
| - | |
|---|---|