Docker Compose 部署 jenkins

Docker Compose 部署 jenkins

jenkins 部署

Docker-Compose 部署

yml 复制代码
version: '3.1'
services:
  jenkins:
    image: 'jenkinsci/blueocean'
    volumes:
      - /data/jenkins/:/var/jenkins_home
      - /var/run/docker.sock:/var/run/docker.sock
      - /usr/bin/docker:/usr/bin/docker
      - /usr/lib/x86_64-linux-gnu/libltdl.so.7:/usr/lib/x86_64-linux-gnu/libltdl.so.7
    privileged: true
    user: root
    restart: always
    container_name: jenkins
    environment:
      JAVA_OPTS: '-Djava.util.logging.config.file=/var/jenkins_home/log.properties'
    ports:
      - 8345:8080
      - 50000:50000
  1. 浏览器访问 8345 端口,稍等 jenkins 加载完成的时候,浏览器页面会自动刷新!

  2. 安装浏览器提示,找到root 密码,配置 jenkins

    shell 复制代码
    # 上述的 docker-compose 文件并没有映射 jenkins 的管理员密码,需要进入docker容器中查看:
    
    docker exec -it contianer-id bash
    
    cat /var/jenkins_home/secrets/initialAdminPassword`
  3. 安装推荐的 jenkins 插件;

    shell 复制代码
    # 如果插件安装失败,需要为 jenkins 换源。
    https://www.jianshu.com/p/2389ed2d2cb0
    https://blog.csdn.net/weixin_45878889/article/details/123867587
    
    # docker-compose 已经将 jenkins 的安装目录挂载到了外部,进入 /data/jenkins/updates 文件夹,直接更新 default.json 配置文件即可
相关推荐
雪可问春风1 天前
docker环境部署
运维·docker·容器
双份浓缩馥芮白1 天前
【Docker】Linux 迁移 docker 目录(软链接)
linux·docker
kobe_OKOK_1 天前
S7 adapter Docker run
运维·docker·容器
一个欠登儿程序员1 天前
在国产服务器上通过 Docker 部署 Windows 虚拟机
服务器·windows·docker
Hadoop_Liang1 天前
构建Spring Boot项目Docker镜像
spring boot·后端·docker
Learn-Python1 天前
修改docker容器内文件后让其生效
运维·docker·容器
http阿拉丁神猫1 天前
kubernetes知识点汇总37-42
云原生·容器·kubernetes
赵丙双1 天前
docker restart 策略
docker·restart
工具罗某人1 天前
docker实现redis-cluster模式集群部署
java·redis·docker
L1624761 天前
Containerd 完整部署安装与使用指南
容器