https://github.com/ingwinlu/docker-git-server
Minimal containerized git repository server
https://github.com/ingwinlu/docker-git-server
docker git minimal
Last synced: 4 months ago
JSON representation
Minimal containerized git repository server
- Host: GitHub
- URL: https://github.com/ingwinlu/docker-git-server
- Owner: ingwinlu
- License: apache-2.0
- Created: 2017-08-17T19:37:04.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-12-17T11:12:06.000Z (almost 4 years ago)
- Last Synced: 2023-08-18T10:44:45.497Z (about 2 years ago)
- Topics: docker, git, minimal
- Language: Shell
- Size: 10.7 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# docker-git-server
A simple dockerized git repository server. Also available on
[Docker Hub](https://hub.docker.com/r/winlu/docker-git-server/).
## Usage
Start the container:
```
docker run -d -p 1234:22 \
--name git_server \
-v git_data:/git/data \
winlu/docker-git-server
```
Or a simple `docker-compose up` (you might want to edit the source of
the image in).
Add a user:
```
docker exec git_server sh add_git_user.sh winlu "`cat ~/.ssh/id_rsa.pub`"
```
Initialize a repo:
```
ssh localhost -p 1234 "init my_repo.git"
```
Add remote to your git repository:
```
git remote add docker_git_server ssh://localhost:1234/~/my_repo.git
```
And push:
```
git push docker_git_server --set-upstream master
```
## Persistence
It is recommended to use a docker volume for persistence because of
file permission issues. All data (setup users, repositories, ssh server keys)
is kept alive during container removal/upgrade.