Skip to main content

Posts

Showing posts from December, 2017

Running Jenkins inside Docker

Whether you are a beginner to Jenkins and want to have your setup done quickly or you want to harness the full power of containers by running Jenkins in Docker, this simple step-by-step tutorial is for you. Running Jenkins in Docker We will pull Jenkins Docker image from Docker repository: docker pull jenkins Using below command we will map ‘jenkins’ directory in my working directory ( $PWD/jenkins)   to  /var/jenkins_home   directory in container and map port 49001 on host to 8080 on container. docker run -d -p 49001:8080 -v $PWD/jenkins:/var/jenkins_home:z -t jenkins Now to run jenkins, just give http://localhost:49001/ . You can proceed with the setup and management of Jenkins now. Your entire Jenkins setup has been created in the 'jenkins' directory which you mapped earlier. Go ahead and take a look!  Packaging app in Docker and pushing to repository Sometimes you would want to package your app as a Docker image and publish to the Docke