简体   繁体   English

如何在Openshift平台上通过Jenkins管道运行docker-in-docker?

[英]How to run docker-in-docker through Jenkins pipeline on Openshift platform?

I am trying to build the docker image in jenkins on openshift platform. 我正在尝试在openshift平台上用jenkins构建docker镜像。 But I am getting error like is unix://var/run/docker docker daemon running? 但是我收到错误,例如is unix://var/run/docker docker daemon running?

unix://var/run/docker is a Unix domain socket . unix://var/run/dockerUnix域套接字 In Unix it is through sockets that different processes communicate and it is through var/run/docker.sock file that host can communicate to the main docker process. 在Unix中,主机可以通过套接字与不同的var/run/docker.sock进程进行通信,而var/run/docker.sock文件则可以通过var/run/docker.sock与主var/run/docker.sock进程进行通信。

Now like everything in unix the sockets are also files and thus we can give permissions to a user who can communicate to this file. 现在,就像Unix中的所有内容一样,套接字也是文件,因此我们可以向可以与该文件进行通信的用户授予权限。

In your case your your jenkins user doeesn't have access permissions to this socket file and thus can't communicate to main docker process. 在您的情况下,您的jenkins用户没有对此套接字文件的访问权限,因此无法与主要docker进程进行通信。

For getting permissions you can do the following as mentioned here : 要获得许可,您可以按照此处所述执行以下操作:

Create a docker group and add your jenkins user to the docker group. 创建一个docker组并将您的jenkins用户添加到docker组。

For more details you can refer to this stackoverflow question 有关更多详细信息,您可以参考 stackoverflow问题

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

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