A jenkins slave image supports:
- Docker in Docker
- OpenJDK 8
- SSH Slave
- Node Version Manager
- node.js v8.11.4 installed by nvm
- JFrog CLI
- Firefox v61.0.2 for headless Selenium test
- gnome-keyring and keytar
- w3c Link Checker: (This is optional.)
- Other Ubuntu packages:
- curl
- wget: (This is optional.)
- pax
- bzip2
- rsync
- vim
- sshpass
- jq
Currently published to Docker hub: jackjiaibm/ibm-jenkins-slave-nvm.
To build image, run command docker build -t jackjiaibm/ibm-jenkins-slave-nvm .
.
To test run image, run command:
$ docker run --rm -it --privileged jackjiaibm/ibm-jenkins-slave-nvm <public key>
# or
$ docker run --rm -it --privileged -e "JENKINS_SLAVE_SSH_PUBKEY=<public key>" jackjiaibm/ibm-jenkins-slave-nvm
For example, use your local SSH public key:
$ docker run --rm -it --privileged jackjiaibm/ibm-jenkins-slave-nvm "$(cat ~/.ssh/id_rsa.pub)"
After the Jenkins client container is started, you can use docker ps
find the container and user docker exec -it -u jenkins <container-id> bash
to connect to the container.
openjdk:8-jdk
which is Debian 9 (Stretch).
This docker image is a modified version from official jenkins/ssh-slave
, and can be used as Connect method
- Connect with SSH
with user jenkins
. The modification is installing nvm before declare "VOLUME /home/jenkins", so changes done by nvm install can be saved.
With nvm, the jenkins user doesn't require sudo to run npm install
. This is explanation from npmjs.org: https://docs.npmjs.com/getting-started/fixing-npm-permissions#option-one-reinstall-with-a-node-version-manager.