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