Jenkins is a self-hosted automation server for CI/CD pipelines.
This setup runs a Jenkins controller with persistent home data and Docker access.
flowchart LR
Dev([Developer]) -->|:8082| Jenkins[Jenkins UI]
Jenkins --> Docker[Docker Engine]
Jenkins --> Data[(./data)]
Agent([Agent]) -->|:50000| Jenkins
- Jenkins container starts and serves the web UI.
- Pipeline/job configuration is stored in mounted
./data. - Jenkins can run Docker-based builds through mounted
docker.sock. - Plugin bootstrap can use
plugins.txtmounted read-only.
- Image:
jenkins/jenkins:latest-jdk21 - Container name:
jenkins - Ports:
8082:8080(web UI)50000:50000(agent port)
- Persistent data:
./data:/var/jenkins_home
- Additional mounts:
./plugins.txt:/usr/share/jenkins/ref/plugins.txt:ro/var/run/docker.sock:/var/run/docker.sock/usr/bin/docker:/usr/bin/docker
Current compose includes:
JAVA_OPTS=-Djenkins.install.runSetupWizard=falseTZ=Asia/Manila
.env.example exists if you want to externalize values.
From the repository root:
cd jenkins
docker compose up -dOpen:
http://localhost:8082
Useful commands:
docker compose ps
docker compose logs -f
docker compose restart
docker compose down- Mounting Docker socket gives Jenkins strong control of host Docker.
- Consider pinning Jenkins/plugin versions for reproducible CI environments.