首页 > 其他分享 >Jenkins 基于 Docker 部署

Jenkins 基于 Docker 部署

时间:2024-09-22 15:17:40浏览次数:7  
标签:www compose 部署 jenkins Jenkins Docker docker

1、Docker、Docker-Compose安装

https://www.cnblogs.com/a120608yby/p/9883175.html
https://www.cnblogs.com/a120608yby/p/14582853.html

2、基于Docker-Compose部署Jenkins

# vim docker-jenkins/docker-compose.yml
services:
  jenkins:
    image: jenkins/jenkins:lts-jdk17
    container_name: jenkins
    user: root
    privileged: true
    restart: always
    networks:
      - ops_default
    ports:
      - "8080:8080"
      - "50000:50000"
    environment:
      - JAVA_OPTS=-Djenkins.install.runSetupWizard=false
    volumes:
      - ./jenkins_home:/var/jenkins_home
      - /var/run/docker.sock:/var/run/docker.sock
      - /usr/bin/docker:/usr/bin/docker
      - ./tools:/usr/local/tools    # jdk1.8、maven、node等工具

networks:
  ops_default:
    external: true

3、启动服务

docker compose up -d

4、查看服务启动状态

docker compose ps

参考:

https://www.jenkins.io/doc/book/installing/docker/

  

标签:www,compose,部署,jenkins,Jenkins,Docker,docker
From: https://www.cnblogs.com/a120608yby/p/18425310

相关文章