A custom jenkins docker image with some plugins and git credentials set up based off the official docker image.
Official jenkins repo Official jenkins on docker hub
cp jenkins/ssh-key-example jenkins/ssh-key
ssh-keygen -t ed25519
# Update jenkins/ssh-key
# Add jenkins/ssh-key.pub to GitHub (or other provider)
make buildAndRun
Using nvm in a build:
stage('NVM') {
steps {
sh '''
#!/usr/local/bin/bash
source ~/.bashrc
nvm --version
'''
}
}
-
-
FROM jenkins/jenkins:lts MAINTAINER [email protected] USER root # Install the latest Docker CE binaries RUN apt-get update && \ apt-get -y install apt-transport-https \ ca-certificates \ curl \ gnupg2 \ software-properties-common && \ curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg > /tmp/dkey; apt-key add /tmp/dkey && \ add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \ $(lsb_release -cs) \ stable" && \ apt-get update && \ apt-get -y install docker-ce
-