Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ttristan/225fc57038f71fddf11cddb87de65fe4 to your computer and use it in GitHub Desktop.
Save ttristan/225fc57038f71fddf11cddb87de65fe4 to your computer and use it in GitHub Desktop.

Step 1

docker run -d \
  -v jenkins_home:/var/jenkins_home \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -p 8080:8080 -p 50000:50000 \
  --name jenkins \
  jenkins/jenkins:lts 

What it does:

Step 2

Step 3

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

Step 4

# inside jenkins container:
usermod -a -G docker jenkins
docker restart jenkins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment