如何在独立的Jenkins中使用docker命令运行jenkins管道作业 [英] How to run jenkins pipeline job with docker commands in stand alone Jenkins

查看:112
本文介绍了如何在独立的Jenkins中使用docker命令运行jenkins管道作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个jenkins管道脚本,该脚本创建Docker映像并将其部署到Docker集线器.我已经安装了docker插件,但是它抱怨找不到docker命令" .我不确定是否需要在同一台机器上安装docker或发生其他情况?

I have a jenkins pipeline script which creates the Docker image and deploys it to the docker hub. I have installed the docker plugin but it complains about "docker command not found". I am not sure if I need to install docker in the same machine or something else need to happen?

推荐答案

是的,您必须在运行docker插件的管道脚本的从机上安装docker.我建议将标签docker添加到已安装docker的从属服务器,然后将管道脚本用作:

Yes you have to install docker on the slave machine which is running that pipeline script of docker plugin. I would suggest adding a label docker to the slave that has docker installed and then use the pipeline script as:

node('docker') {
...
}

这篇关于如何在独立的Jenkins中使用docker命令运行jenkins管道作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆