Files
compose-anything/src/jenkins
Sun-ZhenXing c03771751c feat(opensandbox): add initial configuration files and documentation for OpenSandbox platform
feat(elasticsearch): upgrade Elasticsearch version to 9.3.0 in environment and docker-compose files

feat(gitlab): update GitLab version to 18.8.3-ce.0 in environment and docker-compose files

feat(grafana): bump Grafana version to 12.3.2 in environment and docker-compose files

feat(jenkins): upgrade Jenkins version to 2.541-lts-jdk17 in environment and docker-compose files

fix(minio): remove unnecessary newline in docker-compose file

feat(nginx): downgrade Nginx version to 1.28.2-alpine3.22 in environment and docker-compose files

feat(ollama): update Ollama version to 0.14.3 in environment and docker-compose files

feat(prometheus): upgrade Prometheus version to 3.5.1 in environment and docker-compose files

feat(rabbitmq): update RabbitMQ version to 4.2.3-management-alpine in environment and docker-compose files
2026-02-07 18:11:02 +08:00
..
2025-10-02 17:46:58 +08:00
2025-11-08 21:57:17 +08:00

Jenkins

English | 中文

This service deploys Jenkins, an open-source automation server for CI/CD pipelines.

Services

  • jenkins: The Jenkins automation server.

Environment Variables

Variable Name Description Default Value
JENKINS_VERSION Jenkins image version 2.486-lts-jdk17
JENKINS_HTTP_PORT_OVERRIDE Host port mapping for HTTP (maps to port 8080) 8080
JENKINS_AGENT_PORT_OVERRIDE Host port mapping for agents (maps to port 50000) 50000
JENKINS_OPTS Additional Jenkins options --httpPort=8080
JAVA_OPTS Java JVM options -Djenkins.install.runSetupWizard=false -Xmx2g
CASC_JENKINS_CONFIG Configuration as Code directory /var/jenkins_home/casc_configs
JENKINS_USER_ID User ID for Jenkins process 1000
JENKINS_GROUP_ID Group ID for Jenkins process 1000

Please modify the .env file as needed for your use case.

Volumes

  • jenkins_home: A volume for storing Jenkins data, configuration, and workspace.
  • /var/run/docker.sock: Docker socket (read-only) for Docker-in-Docker functionality.
  • ./jenkins.yaml: Optional Configuration as Code file.

Initial Setup

  1. Start the service:

    docker compose up -d
    
  2. Get the initial admin password:

    docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword
    
  3. Access Jenkins at http://localhost:8080 and complete the setup wizard.

Configuration as Code

Jenkins can be configured using Configuration as Code (JCasC). Create a jenkins.yaml file with your configuration and mount it to /var/jenkins_home/casc_configs/jenkins.yaml.

Example configuration:

jenkins:
  systemMessage: "Jenkins configured automatically by Jenkins Configuration as Code plugin"
  
  securityRealm:
    local:
      allowsSignup: false
      users:
       - id: admin
         password: admin123

  authorizationStrategy:
    loggedInUsersCanDoAnything:
      allowAnonymousRead: false

Security Notes

  • Change the default admin password immediately after setup
  • Consider using HTTPS for production deployments
  • Regularly update Jenkins and its plugins for security patches
  • Use proper authentication and authorization strategies
  • Restrict access to the Jenkins web interface