This image provides an UBUNTU container with a preinstalled git server.
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.
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
GIT_PASSWD = Initializes the git user's password
ROOT_PASSWD = Initializes the root password of UBUNTU
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
See my source code on https://github.com/mbinnun/Dockers/tree/main/ubuntu-git-server
Content type
Image
Digest
Size
120.7 MB
Last updated
over 5 years ago
docker pull mbinunn/ubuntu_git_server