Skip to content

CyrilSiman/jenkins-dind-ssh-slave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Build Status

Directly inspired from jenkinsci/ssh-slave and jenkins/ssh-slave

How to use this image with Docker Plugin

Test in Jenkins

Extend this image

Why this image ?

I used this image as FROM for my Jenkins Docker slaves

Compare to ssh-slave this image have some important differences :

  • this version is based on Alpine instead Debian (~311Mo vs ~658Mo)
  • it's a Docker In Docker version (you can use Docker inside) based on official Docker 17.11 DinD image
  • Pre-installed : git, subversion, curl, wget

Jenkins DinD SSH slave Docker image

Available on Docker Hub wedroid/jenkins-dind-ssh-slave

How to use this image with Docker Plugin

To use this image with Jenkins just follow Launch via SSH paragraph in this page (Docker Plugin) and use wedroid/jenkins-dind-ssh-slave instead jenkins/ssh-slave

  • This image is made to only works with Jenkins ssh user (Jenkins user have right to use Docker without sudo)

  • To run Docker in Docker, the parent container needs to be run with privileged. (option available in Container settings… menu)

Test in Jenkins

  1. In Jenkins, create an item and choose Freestyle project,

  2. Fill Restrict where this project can be run field with the label set in plugin configuration

  3. Add a build step, select Execute shelland fill field with /usr/local/bin/docker --version

  4. Save and execute your build

  5. After execution, check the console log and search some thing like this

    + /usr/local/bin/docker --version
    Docker version 17.10.0-ce, build f4ffd25
    

Extend this image

(sample with Node)