I need to run my own docker image in jenkins pipeline job and my jenkins is already running in a container?
Is there any possible way to do it?
I need to run my own docker image in jenkins pipeline job and my jenkins is already running in a container?
Is there any possible way to do it?
Another approach is to configure jenkins slave so that child docker containers are invoked on the same docker host as jenkins slave siblings, and not inside dockerized jenkins slave.
This approach has certain limitations (e.g. when mounting folders) but avoids running nested dockers.
docker run -v /var/run/docker.sock:/var/run/docker.sock
Details are here: https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci
There are a number of docker images built exactly for this purpose. Try this one for example - https://hub.docker.com/r/tehranian/dind-jenkins-slave/