Docker based Git SSH server for testing purposes.
-
Run Git server.
docker-compose up -d
-
Add local public SSH key to the server's
git
user.docker-compose exec git-server /bin/ash -c \ "echo '<ssh public key>' >> /home/git/.ssh/authorized_keys"
-
Create Git repository
foo
.docker-compose exec git-server /bin/ash -c "\ mkdir -p /git/foo \ && git init --bare /git/foo \ && chown -R git:git /git \ "
-
Clone Git repository
foo
.git clone ssh://git@localhost:2222/git/foo \ && cd foo
-
Commit and push to the Git repository
foo
.echo "baz" > bar \ && git add bar \ && git commit -m "baz into bar" \ && git push origin HEAD
Run locally built image
docker-compose up
Rebuild image
docker-compose build
See the LICENSE.md file for details