Files
dockerfiles/gitserver/README.md
2024-01-20 11:52:52 +01:00

1.3 KiB

Docker-Gitserver

Docker-Gitserver is a containerized GIT server.

Requirements

Usage

Starting server

For the initial start, just run the following:

docker-compose up -d

Remember the container id (refered to as $container), it's printed as Creating $container.

Starting without docker-compose

If you can't or don't want to use docker-compose, run

docker run -d --name git \
  -p 22124:22 \
  -v "${GIT_DATA}:/home/git/repositories" \
  -e "PUBKEY=$(cat ~/.ssh/id_ed25519.pub)" \
  uleenucks/gitserver:latest

Stopping server

docker-compose stop

Creating a repo on server

To create a new repo named $open, use the following:

Open a shell on the server

docker exec -it $container sh

The container name $container is printed on startup.

Create new repository on server

create_repo /home/git/repositories/open.git

This will create open.git as a new repository on your server

Connecting to your git repository

From any client do the following:

git remote add origin ssh://git@<fqdn>:22124/home/git/repositories/open.git