Cannot add gitlab repository in jenkins

jenkins and gitlab are containers under docker. Adding git warehouse under jenkins is shown in figure

.

clipboard.png

ssh keyjenkinssshgitlabjenkinsgit clone

clipboard.png

cloneclone

clipboard.png

there are several questions:
1. Should the ssh public and private keys of the container be the same as the host?
2. Is it related to the user of the container? Because the jenkins user used for the jenkins container
3. How should I investigate the cause now?


ssh -T git@gitlab.com

see if you can connect first


according to my experience and the reference I saw later,
it is not used here at all, because the account configured below is not used at all, so the correct way is to build it directly after configuration. At this time, jenkins will use the account secret configured below to pull the code from the git server. If it cannot be pulled normally, there will also be corresponding error messages in console log, and the corresponding solution will be fine.

Menu