docker-compose 部署 Jenkins

2022-10-02 14:01:12 浏览数 (1)

vim docker-compose.yml

代码语言:yaml复制
version: "3.7"
  
services:
  jenkins:
    image: jenkins:2.371-jdk11
    container_name: jenkins
    hostname: jenkins
    restart: always
    user: root

    volumes:
      - /data/jenkins_home:/var/jenkins_home
      - /etc/localtime:/etc/localtime
      - /var/run/docker.sock:/var/run/docker.sock
      - /usr/bin/docker:/usr/bin/docker
      - /root/.ssh:/root/.ssh
      - /usr/local/node:/usr/local/node
      - /usr/local/maven:/usr/local/maven
      - /usr/local/jdk:/usr/local/jdk

    ports:
      - 8080:8080
      - 50000:50000

    environment:
      - JAVA_OPTS="-Duser.timezone=Asia/Shanghai"
      - TZ=Asia/Shanghai

0 人点赞