简体   繁体   English

如何在Mac上从Jenkins运行Docker构建?

[英]How to run docker builds from Jenkins on a Mac?

How can I from my locally installed Jenkins run a docker build on my Mac? 如何从本地安装的Jenkins在Mac上运行docker build Normally when I run docker build I need to do it from the Docker Quickstart Terminal but now I want to have Jenkins make the docker call. 通常,当我运行docker build我需要从Docker Quickstart Terminal但是现在我想让Jenkins进行docker调用。 Clearly simply running docker build... as an "Execute shell" component in Jenkins... 显然,简单地将docker build...作为Jenkins中的“ Execute shell”组件运行...

Must I run a separate Docker image with Jenkins which runs the docker build command? 我是否必须使用运行docker build命令的Jenkins运行一个单独的Docker映像?

There is a Jenkins's plugin that help you to manage integration with Docker. 有一个Jenkins的插件可以帮助您管理与Docker的集成。 https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin

I wrote this blogpost, maybe it's a little big over your question but I hope to be helpful http://gianarb.it/blog/docker-inside-docker-and-jenkins-2 我写了这个博客文章,也许它对您的问题有点大,但是我希望对您有所帮助http://gianarb.it/blog/docker-inside-docker-and-jenkins-2

The idea could be, just to start, install docker into the same Jenkins's server and build your project directly with a shell command, push this image inside a registry and you can use: 这个想法可能只是开始,将docker安装到同一Jenkins的服务器上,并使用shell命令直接构建您的项目,将该映像推送到注册表中,您可以使用:

docker pull registry:username/imagename

to update your local image.. it's not a good practice build from Jenkins on your local machine. 更新您的本地映像。.在您的本地计算机上从Jenkins进行构建不是一个好习惯。 The concept is: Jenkins build and push your image and you will update that in your local/dev/prod environment. 概念是:Jenkins构建并推送您的映像,然后您将在本地/ dev / prod环境中对其进行更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM