This project can be used for deploying a local instance of Jenkins, using Docker Compose, with Docker (and Compose) capabilities in it.
| docker-compose.yaml | add readme | |
| Dockerfile | use jenkins lts version; install latest docker-compose | |
| README.md | add readme | |
Local Jenkins with Docker & Compose
This project can be used for deploying a local instance of Jenkins, using Docker Compose, with Docker (and Compose) capabilities in it.
Configuration
| Host environment variable | Default value | Description |
|---|---|---|
YOUR_HOST_DOCKER_GID |
997 |
Your host's Docker group ID, which will be mapped into the Docker image. |
AN_ALTERNATIVE_GID |
990 |
An alternative number to assign as a group ID, to replace whatever may be occupying the above host docker group ID. |
JENKINS_PORT |
8080 |
The host port to map for exposing the Jenkins container locally. |
Deployment
export HOST_DOCKER_GID=$(getent group docker | cut -d ':' -f 3)
docker volume create jenkins_home
docker compose up -d
Cleanup
docker compose down
docker volume rm jenkins_home # optional
Caveats
Based on your host's docker group ID (HOST_DOCKER_GID), it could conflict with an existing group ID in the Jenkins Docker image. If so then there is an optional alternative value (AN_ALTERNATIVE_GID) which can replace the conflicting group ID without affecting the host configuration.