how to use port remapping using JNLP with Dockerized Jenkins using JCASC ?

5 views
Skip to first unread message

monger_39

unread,
Jun 17, 2020, 3:42:22 AM6/17/20
to jenkins...@googlegroups.com
Hi,
I have been experimenting with Dockerized Jenkins (incl JCasC). Only the master is dockerized for now.
My Jenkins agents are started from the agent, and connect via JNLP.
The master (internal) port is 8080. the JNLP port is 50000. Both defined in the JCasC configuration.


  location:
    adminAddress: "<adm...@mydomain.com>"
    url: "http://MASTER:8080/"

  slaveAgentPort: 50000


I tried starting a Jenkins instance with remapped ports, like: 

   docker run -p 8080:9090 -p 50000:60000 <JENKINS_MASTER>

But this leads to agent connection issues.

* the master itself has the port (actually the Jenkins URL) coded inside the jcasc config file. 
    Can I take in the port mapping from the docker '-p' option ? Having a 'wrong' URL leads 
    to strange issues.
* the JNLP port remapping does not seem to work at all; here also the default port is defined
    in the JCasC file, and afaict passed back to a connecting agent via the HTTP response header.
    Consequently the slave communicates via the default JNLP port to the master docker instance.

Any one who has a working setup ?

thx, M


Reply all
Reply to author
Forward
0 new messages