Last active
October 15, 2018 18:38
-
-
Save nikhilw/57858162f35b9e7bacd4aec6a8ea95a0 to your computer and use it in GitHub Desktop.
docker Jenkins reusable container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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