Small SSH container intended for providing access to git repos
409
Small container to run OpenSSH so that Git repos can be hosted.
Initial setup
mkdir basedir
chmod 700 basedir
echo > basedir/authorized_keys
chmod 600 basedir/authorized_keys
sudo chown -R 1001:1001 basedir
Running the container
docker run -d --name repos -v $PWD/basedir:/repos -p 1922:22 bentasker12/ssh-git-repos:latest
Would bind to 1922
You can then create a repo with
docker exec repos add_repo my_repo.git
The following SSH config
Host repotest
Port 1922
Hostname 127.0.0.1
User git
Would then allow you to
git clone repotest:my_repo.git
Once you've added your public key to basedir/authorized_keys
Content type
Image
Digest
Size
11.5 MB
Last updated
almost 5 years ago
docker pull bentasker12/ssh-git-repos