Build and setup Jenkins JNLP agent Docker image with Node.js installed and Docker mounted from host machine.
Docker image available at https://hub.docker.com/r/zulhilmizainuddin/jenkins-agent-nodejs/
Docker pull command
docker pull zulhilmizainuddin/jenkins-agent-nodejs
- Ubuntu 16.04 LTS (Xenial Xerus)
- Docker version 17.12.0-ce
docker pull jenkins/jenkins:lts
docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts
-
Go to
Manage Jenkins
->Configure System
->Jenkins Location
->Jenkins URL
Example:
http://172.17.0.1:8080/
- Go to
Manage Jenkins
->Configure Global Security
->Agents
- Set
TCP port for JNLP agents
toFixed
with port50000
- Go to
Manage Jenkins
->Manage Nodes
->New Node
- Select
Permanent Agent
- Set
Remote root directory
to/home/jenkins
- Set
Launch method
toLaunch agent via Java Web Start
- Note the
secret
andagent name
docker build -t jenkins-agent-nodejs:latest .
or
docker pull zulhilmizainuddin/jenkins-agent-nodejs
docker run \
-v $(which docker):/usr/bin/docker \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /usr/lib/x86_64-linux-gnu/libltdl.so.7:/usr/lib/libltdl.so.7 \
jenkins-agent-nodejs:latest -url http://172.17.0.1:8080 <secret> <agent name>