I have setup a docker-container for jenkins (name: jenkins-01) on my Synology NAS. I also have setup the git-server provided by Synology on the same NAS. To access the git-repositories from jenkins-01 I created a user "jenkins" on the NAS.
My git-server on the NAS is accessible by SSH and I can access repositories from my desktop-machine.
This is an example of the URL I use:
ssh://jenkins@<ip>:<port>/volume1/gitrepos/<repo>
With that URL I can clone a from my desktop-machine. I also setup a docker container using the exact same docker-compose.yml-file as provided on my NAS on my desktop machine. Within that jenkins-instance I can create a pipline using the URL shown here without any problems. So basically I am sure that the URL and the SSH-credentials used are fine.
However when I try to do the same thing within the jenkins-instance running as docker container on my NAS, I can't get a connection to the same git-server using the URL. The message provided is that the URL is not valid. I also tried to replace the by the gateway-ip configured in the jenkins-instance.
To find out the gateway-ip I used the following command on the NAS:
docker container inspect jenkins-01
This is the docker-compose.yml I use:
version : "3"
services:
app:
image: jenkins/jenkins:lts-jdk11
container_name: jenkins-01
privileged: true
user: root
networks:
vlan_devnet:
ipv4_address: 172.18.100.2
ports:
- 51080:8080
- 51000:50000
volumes:
- ./jenkins_home:/var/jenkins_home
- ./etc/resolv.conf:/etc/resolv.conf
environment:
JAVA_OPTS: -Duser.timezone=CET
restart: unless-stopped
networks:
vlan_devnet:
external: true
What do I miss?
I never figured this out and I no longer bother because I now use GitEA as Git-Server instead of the Synology Git-Server.
GitEA also provides a nice WebUI and similar functionality as GitHub - a very nice OpenSource project.
Because of that I will close this
I use now GitEA, so don't have to bother with the Synology Git-Server. I know this does not answer the original question - however it works for me.