Skip to content

Docker image for running Docker command inside Jenkins jobs

License

Notifications You must be signed in to change notification settings

LeoAref/jenkins-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Jenkins-Docker Packagist

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

First steps

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

Working example

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

About

Docker image for running Docker command inside Jenkins jobs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published