Gitlab warehouse cannot be added in jenkins.

  docker, question

Jenkins and gitlab are containers under dock. when adding git warehouse under jenkins, an error is reported as shown in the figure below.


I think it should be the problem of ssh key, but I have generated ssh private key in jenkins container, and transferred the public key to gitlab. after giving it a try in git clone in jenkins container, I can’t do it either. the error is shown in the figure below.


I can clone successfully at the host computer, and I can clone successfully at other computers, which shows that there is no problem in the warehouse.


There are several questions:
1. Does the ssh public and private key of the container need to be consistent with the host?
2. Is it related to the user of the container? Because jenkins users for jenkins containers
How should I check the reason now?

ssh -T

Let’s try if we can connect first.