/jenkins-agent-dind

A full fledged Docker in Docker image to act as a Jenkins Agent.

Primary LanguageDockerfileMIT LicenseMIT

Jenkins Agent with Docker in Docker

CI Docker Pulls Docker Image Size

A full fledged Docker in Docker image to act as a Jenkins Agent. Based on buildpack-deps:focal, it is a mashup of jenkins/inbound-agent with docker:dind.

Features

  • Based on Ubuntu 20.04 Focal Fossa: a more common OS to run your builds.
  • From buildpack-deps: a image with many common dependencies installed, run your builds without hassle.
  • It contains the latest release of agent.jar: even more up-to-date then jenkins/agent itself.
  • Fully working Docker in Docker: run your docker build commands with no intervention and share of resources between the host.
  • Act just as a Jenkins Agent out-of-the-box: run ephemeral build containers by using Docker Plugin (or Kubernetes Plugin) for Jenkins. Works as the official jnlp/inbound-agent.

Usage

Command line

Spin this agent in shell, if you want to play with it:

# Fetches the latest version
docker pull ghcr.io/felipecrs/jenkins-agent-dind
# -ti: allocates a pseudo-TTY in order to run bash
# --rm: removes the container after using it (don't forget to remove the volumes created by it)
# --privileged: needed for running Docker in Docker
docker run -ti --rm --privileged felipecrs/jenkins-agent-dind bash

Agent Template in Docker Cloud configuration on Jenkins

Sample Agent Template configuration