在(Docker裡的)Jenkins裡運行Docker實踐

來源:互聯網
上載者:User

標籤:

按照在(Docker裡的)Jenkins裡運行Docker( http://www.dockone.io/article/431)進行實踐。
通過該文章,可以快速瞭解如何在一個容器(這裡是Jenkins容器)裡裝載Docker sock以便建立其“兄弟”容器,有人稱之為DooD(Docker-outside-of-Docker),以區別於DinD(Docker-in-Docker),後者是在容器中安裝一個完整的隔離的Docker版本。 當然,也可以在Jenkins容器中使用Docker命令執行其他Docker相關的操作。 在實踐的同時將源碼(主要是Dockerfile和README.MD)託管到GitHub。 1、從Github拉取源碼 git clone  https://github.com/donhui/docker-jenkins.git 2、構建鏡像 docker build -t myname/jenkins:1.609.1 docker-jenkins/Dockerfile 3、基於鏡像運行容器(注意把docker.sock和docker映射到jenkins容器裡 ) docker run -d --name myjenkins -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker -p 8080:8080 myname/jenkins:1.609.1
4、Jenkins建立JOB,構建步驟選擇Execute shell,內容為:sudo docker images,構建後日誌輸出如下:
參考: jenkins官方鏡像( 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中文翻譯版( http://www.dockone.io/article/431)

在(Docker裡的)Jenkins裡運行Docker實踐

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.