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/

  

posted on 2024-09-22 15:09  a120608yby  阅读(12)  评论(0编辑  收藏  举报