Git clone – gitlab docker

HowTo: clone from a gitlab server running inside a docker container

  1. Ensure SSH pubkey is setup by following https://docs.gitlab.com/ee/ssh/
  2. Check source port for SSH here:

docker inspect gitlab | jq '.[0].NetworkSettings.Ports."22/tcp"'

  1. This .ssh/config worked for me

Host git
Hostname 127.0.0.1
User git
Identityfile ~/.ssh/id_ed25519
Port 922

  1. Then clone like this:

git clone git@git:root/my-awesome-project.git

If you have found my website useful, please consider buying me a coffee below 😉

Leave a Reply

Your email address will not be published. Required fields are marked *