Skip to content

Instantly share code, notes, and snippets.

@nikhilw
Last active October 15, 2018 18:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhilw/57858162f35b9e7bacd4aec6a8ea95a0 to your computer and use it in GitHub Desktop.
Save nikhilw/57858162f35b9e7bacd4aec6a8ea95a0 to your computer and use it in GitHub Desktop.
docker Jenkins reusable container
#! /bin/bash
# When running for first time, have empty directories; skip the setup by unchecking all plugins, etc.
# then shutdown jenkins, add old files and restart.
# If it fails, make sure the directory docker-volumes/jenkins and all its children are owned by same user, owner of the docker process.
# Or just chown -R on the jenkins directory.
docker run -it --name jenkins --network="permanet" --ip="172.30.0.6" \
-v /home/nikhil/.m2:/var/jenkins_home/.m2 \
-v /home/nikhil/.gradle:/var/jenkins_home/.gradle \
-v /home/nikhil/.npm:/var/jenkins_home/.npm \
-v /home/nikhil/docker-volumes/jenkins/jenkins_home:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
jenkins/jenkins:lts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment