Public Repository

Last pushed: 2 years ago
Short Description
Jenkins Master server derived from official Jenkins Image
Full Description

Dockerfile https://github.com/ah903/assignment-06-infrastructure/blob/master/jenkins-master/Dockerfile

#############################################################################

Mounting Docker Socket I/O so the container can talk to the host instance

of docker and use this to build commends

Docker outside of Docker strategy

#############################################################################

https://github.com/SvenDowideit/dockerfiles/issues/17

https://github.com/sameersbn/docker-gitlab/issues/219

http://container-solutions.com/running-docker-in-jenkins-in-docker/

https://hub.docker.com/_/jenkins/

#############################################################################

See Also
https://engineering.riotgames.com/news/putting-jenkins-docker-container
https://engineering.riotgames.com/news/jenkins-docker-proxies-and-compose
http://engineering.riotgames.com/news/taking-control-your-docker-image

  1. Building the Jenkins Data Container
    docker build -t dev-jenkins-data .

  2. Building the Jenkins DockerFile Image
    docker build -t dev-jenkins-master .

  3. Running the Docker Image without a data volume
    docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker -v /usr/lib/x86_64-linux-gnu/libapparmor.so.1.1.0:/lib/x86_64-linux-gnu/libapparmor.so.1 -p 8080:8080 -p 50000:50000 --name dev-jenkins-master dev-jenkins-master

  4. Setting Up a Data Container
    Running the Jenkins Data Container
    docker run --name=dev-jenkins-data dev-jenkins-data

  5. Running the Docker Image With A Data Container
    docker run --name=dev-jenkins-master -d --volumes-from=dev-jenkins-data -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker -v /usr/lib/x86_64-linux-gnu/libapparmor.so.1.1.0:/lib/x86_64-linux-gnu/libapparmor.so.1 -p 8080:8080 -p 50000:50000 dev-jenkins-master

  6. Backing Up Log Files
    docker cp dev-jenkins-data:/var/log/jenkins/jenkins.log ~/backup/logs/jenkins.log

  7. Backing Up Jenkins Config Files
    docker cp dev-jenkins-data:/var/jenkins_home/config.xml ~/backup/config.xml

  8. backing up Jenkins Jobs
    docker cp dev-jenkins-data:/var/jenkins_home/jobs ~/backup/jobs

Docker Pull Command
Owner
andrewhall

Comments (0)