/jenkins-docker-compose

Basic setup for running Jenkins using docker-compose

Primary LanguageShell

Jenkins Docker Compose

This repo contains a work in progress for running Jenkins, a Jenkins build agent, and Docker-in-Docker, all via a single composition.

Setup

  1. Generate an SSH key pair using ssh-keygen -t rsa or update the ssh_private_key secret in docker-compose.yml to point to your private key.
  2. Replace the JENKINS_SLAVE_SSH_PUBKEY environment variable value with the contents of the corresponding public key.
  3. Run docker-compose build (currently required due to image customizations).
  4. Run docker-compose up -d to start everything.
  5. Run docker-compose logs -f jenkins to watch for the initial Jenkins admin password.
  6. Go to http://localhost:8080/ to set up Jenkins from the install wizard.
  7. After setup, go to the docker-static node page in Jenkins.
  8. Click "Trust SSH Host Key" on the sidepanel to view and save the SSH agent's fingerprint.
  9. You now have a Docker-based agent that can also run docker commands using a containerized Docker!