Run Docker practices in Jenkins (Docker)

Source: Internet
Author: User
Tags docker run docker sock

Follow the practice of running Docker (http://www.dockone.io/article/431) in Jenkins (Docker).
With this article, you can quickly learn how to load Docker sock in a container (here is the Jenkins container) to create its "brother" container, which some call Dood (Docker-outside-of-docker), To distinguish it from Dind (Docker-in-docker), which is the installation of a complete isolated Docker version in the container. Of course, you can also use Docker commands in the Jenkins container to perform other Docker-related operations. In practice, the source code (mainly Dockerfile and README.MD) is hosted on GitHub. 1. Pull source from GitHubgit clone https://github.com/donhui/docker-jenkins.git 2. Build the imageDocker build-t myname/jenkins:1.609.1 Docker-jenkins/dockerfile 3. Run the container based on the image (Be careful to map docker.sock and Docker to the Jenkins container. ) Docker run-d--name myjenkins-v/var/run/docker.sock:/var/run/docker.sock-v $ (which Docker):/usr/bin/docker-p 808 0:8080 myname/jenkins:1.609.1
4, Jenkins create job, build step Choose Execute shell, content: sudo docker images, post-build log output as follows:
Reference: Official Jenkins image (Https://github.com/jenkinsci/docker)
Running-docker-in-jenkins-in-docker (http://container-solutions.com/running-docker-in-jenkins-in-docker/)
Running-docker-in-jenkins-in-docker Chinese Translation version (http://www.dockone.io/article/431)

Run Docker practices in Jenkins (Docker)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.