The problem with docker gitlab ssh

after using the gitlab created by docker gitlab and then starting gitlab, the project is always prompted to enter a password by ssh git clone. The public key has been added to the gitlab project. The startup mode of gitlab is

.
docker run -m 3000M --memory-swap=3400M --detach  --hostname gitlab.example.cn  --publish 20443:443  --publish 20080:80  --publish 20022:22  --name gitlab  --restart always --volume /srv/gitlab/config:/etc/gitlab  --volume /srv/gitlab/logs:/var/log/gitlab  --volume /srv/gitlab/data:/var/opt/gitlab  gitlab/gitlab-ce:latest

I wonder if there is a problem with ssh caused by the 20022 outside of this port? Want to know how to solve it. Thank you

Mar.04,2021

you need to modify the port configuration to 20022 in the configuration file gitlab.rb, and your pull code should use port 20022 instead of the default port 22

Menu