Docker Community Forums

Share and learn in the Docker community.

Docker Running on Jenkins


(Wheelsense) #1

Hi All,

I have Openshift running in my system.I have got a Jenkins image running on it.I have successfully ran the jenkins Classic GUI.However when I am trying to run the docker commands in Execute Shell for example
docker info.It is giving me an error as docker command not found.

I know the issue I have installed the docker plugin from Manage Jenkins.However I am not knowing how to configure it in Manage Jenkins -> Configure System.My main intention is to build docker image out of it which helps for our CI/CD pipeline execution.

Any Help from the community team is highly appreciated.


(Deniszhdanov) #2

Hello,

You need to map your docker socket in jenkins container configuration:

-v /var/run/docker.sock:/var/run/docker.sock


(Wheelsense) #3

Thanks very much deni.

Could you please elloborate little more.If you have some link please share it with me.


(Zpalazov) #4

This link has a lot of info https://github.com/jenkinsci/docker/blob/master/README.md

I personally needed to install Docker client on top of the jenkins/jenkins:lts-slim image, I am not sure this is the correct way but it is hard to find proven working example for running Jenkins container which uses Docker internally.


(Wheelsense) #5

unfortunately it didnt helped me out.Not able to recognize docker commands in jenkins container