docker-compose.yml

version: '3'
services:
  jenkins:
    image: jenkins/jenkins:lts
    ports:
      - "10240:8080"
      - "10241:50000"
    volumes:
      - ./jenkins_home:/var/jenkins_home
      - /etc/localtime:/etc/localtime
      # mount maven home(optional)
      # - /usr/local/maven:/usr/local/maven
      # mount java to jenkins (optional)
      # - YOUR_JAVA_HOME:/usr/local/java
      # mount docker to jenkins (optional)
      # - /usr/local/docker/jenkins/go:/usr/local/go
    environment:
      - TZ=Asia/Shanghai
    user: 0:0
    privileged: true
    container_name: jenkins
    command: >
      bash -c '
        /usr/local/bin/jenkins.sh
      '