An image for running Docker command in Jenkins, it's not docker-in-docker, but instead it enables exposing Docker socket to the Jenkins container
docker pull leoaref/jenkins-docker
docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 --name jenkins-docker leoaref/jenkins-docker
This will pull the image locally, and run a container with mounted docker socket
ssh into the running container jenkins-docker
docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 --name jenkins-docker leoaref/jenkins-docker
docker exec -it jenkins-docker bash
Run test command inside the container
sudo docker ps
It should output something similar to:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f344dc9c58dd f79b24adaa64 "/bin/tini -- /usr..." 4 hours ago Up 4 hours 0.0.0.0:8080->8080/tcp, 50000/tcp jenkins-docker