Sign inSign up

mbinunn/ubuntu_git_server

By mbinunn

•Updated over 5 years ago

UBUNTU based git server

Image
0

949

mbinunn/ubuntu_git_server repository overview


⁠Overview

This image provides an UBUNTU container with a preinstalled git server.


⁠Usage Example:

Assuming that your user has the docker privileges, here is an example for creating and running the container:
docker run -d -t \
-p 22:22 \
-e GIT_PASSWD=my_git_user_password \
--name=MyGitContainer mbinunn/ubuntu_git_server


Or if you want to load your own repositories folder into the container, use this:
docker run -d -t \
-p 22:22 \
-e GIT_PASSWD=my_git_user_password \
-v /path/to/your/repos-folder/:/home/git/repos \
--name=MyGitContainer mbinunn/ubuntu_git_server


The git server will be now up and running.


⁠Manage Repositories Example:

Create an empty repository by running the following command:
docker exec -i -t -u git MyGitContainer bash -c "/home/git/git-create-repo.sh my_new_repo.git"

You can now clone you newly created repo:
git clone ssh://git@localhost:22/~/repos/my_new_repo.git

After making chnages in the folder my_new_repo, you can push them to the git server:
git add .
git commit -m "some changes"
git push origin master


⁠Optional Variables:

GIT_PASSWD = Initializes the git user's password
ROOT_PASSWD = Initializes the root password of UBUNTU


⁠Saving your own image

After making changes, installing software or changing startup.sh, save your own image by using the following command:
docker commit MyGitContainer my_own_git_image:v1


⁠Source code

See my source code on https://github.com/mbinnun/Dockers/tree/main/ubuntu-git-server⁠

Tag summary

Content type

Image

Digest

Size

120.7 MB

Last updated

over 5 years ago

docker pull mbinunn/ubuntu_git_server