First written by Tri Ahmad Irfan (triahmadirfan@gmail.com)
This repository contains a Dockerfile for building an empty Jenkins template on top of Docker, preloaded with PHP QA tools.
Make sure you are in the same directory as the Dockerfile, then call
sudo docker build -t yourname/emptyjenkins .You can list all images available on your instance by calling
sudo docker imagesYou can run a container from a specific image by calling
sudo docker run -dp 8080:8080 --name jenkinsserver yourname/emptyjenkinsNote:
-dwill make the container to run in a daemon/detached mode-p 8080:8080will make the container to run at hostPort:containerPort--name jenkinsserverwill name your containerjenkinsserver, so you can call the container using this name instead of using the hash id
You can map a the $JENKINS_HOME volume into a specific directory on your host machine by adding -v option
sudo docker run -dp 8080:8080 --name jenkinsserver -v /home/yourname/jenkins_home:/var/jenkins_home yourname/emptyjenkins-v /home/yourname/jenkins_home:/var/jenkins_home will map /var/jenkins_home on your container into /home/yourname/jenkins_home on your host machine
After running the container, Jenkins will be available at http://yourpublicdns:8080
You can list all running containers by calling
sudo docker psYou can stop a running container by calling
sudo docker stop jenkinsserverYou can remove an existing container by calling
sudo docker rm jenkinsserver