系统管理-插件管理-可选插件node
Docker plugingit
Docker Slaves Plugingithub
docker-build-stepdocker
以http的形式暴露docker的apishell
docker run --rm \ -p 2375:2375 \ --name shipyard-proxy \ -v /var/run/docker.sock:/var/run/docker.sock \ -e PORT=2375 \ shipyard/docker-proxy:latest
能够参考dind-jenkins-slave自行定义api
系统管理-系统设置-云-新增云maven
docker url
这里为tcp://192.168.99.100:2375,这里的端口为上面docker-http-proxy代理的端口,ip为docker-machine的地址tcp
能够经过 test connection进行测试测试
添加templateui
这里的image即为jenkins-slave的docker镜像
这里的Labels标记为docker-agent,即这个jenkins slave的node的名称
这里的Launch method的Credentials为jenkins/jenkins
选择节点
构建
这里没有使用docker-maven-plugin,而是直接在shell里头根据Dockerfile自行构建镜像