From fc2a8b94b765540e860c7edb1085579ec866faf9 Mon Sep 17 00:00:00 2001 From: Baohua Xie Date: Fri, 26 Jul 2019 10:43:04 +0800 Subject: [PATCH] Create README.md --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..4150304 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# Jenkins JNLP Agent Docker image for DianPlus.cn + +This is an image for [Jenkins](https://jenkins.io) agent (FKA "slave") using JNLP to establish connection. +This agent is powered by the [Jenkins Remoting library](https://github.com/jenkinsci/remoting), which version is being taken from the base [Docker Agent](https://github.com/jenkinsci/docker-slave/) image, and customized by DianPlus.cn. + +## Running + +To run a Docker container + + docker run dianplus/jnlp-slave -url http://jenkins-server:port + +To run a Docker container with [Work Directory](https://github.com/jenkinsci/remoting/blob/master/docs/workDir.md): + + docker run dianplus/jnlp-slave -url http://jenkins-server:port -workDir=/home/jenkins/agent + +Optional environment variables: + +* `JENKINS_URL`: url for the Jenkins server, can be used as a replacement to `-url` option, or to set alternate jenkins URL +* `JENKINS_TUNNEL`: (`HOST:PORT`) connect to this agent host and port instead of Jenkins server, assuming this one do route TCP traffic to Jenkins master. Useful when when Jenkins runs behind a load balancer, reverse proxy, etc. +* `JENKINS_SECRET`: agent secret, if not set as an argument +* `JENKINS_AGENT_NAME`: agent name, if not set as an argument +* `JENKINS_AGENT_WORKDIR`: agent work directory, if not set by optional parameter `-workDir` + +## Configuration specifics + +### Enabled JNLP protocols + +By default, the [JNLP3-connect](https://github.com/jenkinsci/remoting/blob/master/docs/protocols.md#jnlp3-connect) is disabled due to the known stability and scalability issues. +You can enable this protocol on your own risk using the +`JNLP_PROTOCOL_OPTS=-Dorg.jenkinsci.remoting.engine.JnlpProtocol3.disabled=false` property (the protocol should be enabled on the master side as well). + +In Jenkins versions starting from `2.27` there is a [JNLP4-connect](https://github.com/jenkinsci/remoting/blob/master/docs/protocols.md#jnlp4-connect) protocol. +If you use Jenkins `2.32.x LTS`, it is recommended to enable the protocol on your instance.