I have locally installed OpenShift platform. Jenkins has been deployed there as a dockerized application. I need to call Docker during Jenkins job executing to perform some base Docker operations: build, push, pull.
Unfortunately Docker is not reachable out of the Jenkins container.
$ oc exec -it jenkins-1-cdjdx -- /bin/bash
$ docker
bash: docker: command not found
As far as I understood I have to install the Docker plugin and perform a new cloud item for Jenkins global settings. So I would try to describe Docker as a new cloud item but unfortunately I don't know how to define a Docker Host URI and a port.
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:
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.