How to allow Jenkins to call docker out of the container How to allow Jenkins to call docker out of the container kubernetes kubernetes

How to allow Jenkins to call docker out of the container


Docker plugin will not install docker to the container, it will just add docker support to Jenkins.

You need to install docker client inside a Jenkins container. I don't know which image you use, but hope you will find a right way of how to do it.

Than, you have 2 ways of how to make it works:

  1. Attach docker socket from a host machine to your container. It means, you need to mount hosts' /var/run/docker.sock to the same path in the container. In OpenShift you also can use exposeDockerSocket option for a build strategy, but I don't think you use that feature here. But if you run it as a general pod, you need to mount it using "hostPath" volume. Also, I think you will need to modify security policy, check that question.
  2. Run independent Docker right in your container, that mode named Docker-in-Docker. You can google it, but I think the first option is better in your case.