繁体   English   中英

是否有任何配置可以在 jenkins 容器内运行 docker?

[英]Is there any configuration to run docker inside a jenkins container?

I am trying to build an image with docker and then upload it to the docker hub, after passing the quality tests I receive the following error: docker: not found, how can I communicate my docker service (localhost) with the container of jenkins.

重要提示:我在本地安装了 docker 桌面,并且在 windows 10 pro 的本地容器中安装了 jenkins。

错误: https://imgur.com/q1SrKGe管道: https://imgur.com/nQWL1HR

您有 2 个选项可以执行此操作:

  1. 在您的 Jenkins 容器中安装 Docker 并从您的主机为 Docker 套接字添加绑定安装。 否则,容器内的 Docker 守护程序将无法工作。 在 Linux 上,这个套接字是/var/run/docker.sock ,所以绑定挂载看起来像-v /var/run/docker.sock:/var/run/docker.sock
  2. 为安装了 docker 的Building Image Stage 使用不同的从代理。 For eg you could use Docker-in-Docker ( https://hub.docker.com/_/docker ) as a Slave Agent for Jenkins (connected via ssh) and run your docker build inside this slave agent.

暂无
暂无

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

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