Installing Jenkins with Docker | jenkins deploy docker
YoushouldhaveDocker[1]properlyinstalledonyourmachine.CheckDockerinstallationguide[2]fordetails.First,pulltheofficialjenkins[3]imagefromDockerrepository.Next,runacontainerusingthisimageandmapdatadirectoryfromthecontainertothehost;e.gintheexamplebelow/var/jenkins_homefromthecontainerismappedtojenkins/directoryfromthecurrentpathonthehost.Jenkins8080portisalsoexposedtothehostas49001.dockerrun-d-p49001:8080-v$PWD/jenkins:/var/jenkins_home:z-tjenkins/jenkinsAddtionally,youcanconfigurenginx[4]asare...
You should have Docker[1] properly installed on your machine. Check Docker installation guide[2] for details.
First, pull the official jenkins[3] image from Docker repository.
Next, run a container using this image and map data directory from the container to the host; e.g in the example below /var/jenkins_home from the container is mapped to jenkins/ directory from the current path on the host. Jenkins 8080 port is also exposed to the host as 49001.
docker run -d -p 49001:8080 -v $PWD/jenkins:/var/jenkins_home:z -t jenkins/jenkinsAddtionally, you can configure nginx[4] as a reverse proxy to your Jenkins instance, e.g.
upstream app { server 127.0.0.1:49001; } server { listen 80; server_name jenkins.your-domain.com; location / { proxy_pass http://app; } } References Docker (docker.io) Docker installation guide (www.docker.io) jenkins (hub.docker.com) ng...