docker-jenkins-jnlp-slave-windows icon indicating copy to clipboard operation
docker-jenkins-jnlp-slave-windows copied to clipboard

unable to establish connection to master jenkins to docker slavecontainer

Open Rashmithaalloju opened this issue 5 years ago • 6 comments

hi ,

I am trying to establish connection with jenkins master and docker slave container. I was unable to download agent.jar to container and connect it through JNLP URL.

Rashmithaalloju avatar Aug 29 '18 22:08 Rashmithaalloju

sorry to hear you are having issues, I wont be able to help you with you providing me with more information, like the exact error you are seeing, the steps you are using, where are you running it, etc.

Are you building the container yourself? The image downloads the agent when it is built.

JonCubed avatar Aug 30 '18 04:08 JonCubed

Dockerfile.txt

Attached the windows Docker slave . All we need to establish connection with master jenkins.

docker build --build-arg BASE_URL=http://jenkinsmasterURL:8080 -twin_slave-jnlp-2.0 . docker run -ti jenkins_windows_agent -jnlpURL http://jenkinsmaster:8080/computer/slave-agent.jnlp -secret xxxx

i have referenced this blog to setup slave container and establish connection . https://blog.alexellis.io/continuous-integration-docker-windows-containers/

My jenkins master is not in docker. All we need to establish jenkins master connection with docker slave container windows.

Here is the attached error.

29084

Rashmithaalloju avatar Aug 30 '18 05:08 Rashmithaalloju

It looks like the machine you are building the container on or the container itself cannot access your jenkins master.

Have you tried pinging http://jenkinsmasterURL:8080 from the build machine (where you are building the dockerfile)? if that works just run a basic windows container on the build machine and try to ping http://jenkinsmasterURL:8080, hopefully that will narrow down where your problem lies.

JonCubed avatar Aug 30 '18 10:08 JonCubed

You are right. I am doing it on my office laptop may be that would be a fire wall issue??? i was able to ping google from container but cannot connect to the HOST.

Rashmithaalloju avatar Aug 30 '18 17:08 Rashmithaalloju

are you running the jenkins master on your laptop? Is jenkinsmasterURL (whatever you are actually using) a registered domain or just something in your laptop's host file? If it is a local installation you are probably running in a current issue with window containers networking you could instead try host.docker.internal.

Alternatively you can download the agent from the public repo rather than the master, like I do in my dockerfile.

JonCubed avatar Aug 31 '18 14:08 JonCubed

Since it is windows docker. i am unable to clone the git repository inside the docker contianer. i am getting access rights issues.

Rashmithaalloju avatar Sep 04 '18 23:09 Rashmithaalloju