/docker-jenkins-slave

Alpine Docker image for Jenkins slave using Swarm plugin.

Primary LanguageDockerfileMIT LicenseMIT

Jenkins Slave Docker

Docker Pulls

Description

This repository is used for building a Docker image containing Jenkins Inbound Agent running on Alpine Linux

Dockerhub

docker pull scalified/jenkins-slave:<version>

Version

Version
alpine, latest

Mandatory Environment Variables

  • JENKINS_URL: url for the Jenkins server
  • JENKINS_TUNNEL: (HOST:PORT) connect to this agent host and port instead of Jenkins server, assuming this one do route TCP traffic to Jenkins master. Useful when when Jenkins runs behind a load balancer, reverse proxy, etc.
  • JENKINS_SECRET: agent secret
  • JENKINS_AGENT_NAME: agent name

Mandatory Volume Mounts

  • /var/run/docker.sock:/var/run/docker.sock - docker engine
  • /var/jenkins:/var/jenkins - agent working directory (path must be the same on host machine and agent container)

How-To

Building Jenkins Slave Docker Image

docker build . -t scalified/jenkins-slave:<tag>

Pushing Jenkins Slave Docker Image

docker push scalified/jenkins-slave:<tag>

Running Jenkins Slave Docker Image

docker run -name jenkins-slave \
  -e JENKINS_URL=<...> \
  -e JENKINS_SECRET=<...> \
  -e JENKINS_AGENT_NAME=<...> \
  -e JENKINS_AGENT_WORKDIR=<...> \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /var/jenkins:/var/jenkins \
  scalified/jenkins-slave:<tag>

Scalified Links