Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to establish connection to master jenkins to docker slavecontainer #4

Open
Rashmithaalloju opened this issue Aug 29, 2018 · 6 comments

Comments

@Rashmithaalloju
Copy link

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.

@JonCubed
Copy link
Owner

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.

@Rashmithaalloju
Copy link
Author

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

@JonCubed
Copy link
Owner

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.

@Rashmithaalloju
Copy link
Author

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.

@JonCubed
Copy link
Owner

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.

@Rashmithaalloju
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants