Docker安装Jenkins,并容器化

  1. 编写jenkins.yaml文件
yaml 复制代码
version: '3'

services:
  jenkins:
    image: jenkins/jenkins:latest
    restart: always
    container_name: jenkins
    ports:
      - 8005:8080
      - 8006:50000
    volumes:
      - /opt/module/jenkins:/var/jenkins_home
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock
      - /usr/bin/docker:/usr/bin/docker
      - /etc/docker/daemon.json:/etc/docker/daemon.json
      - /opt/module/jdk/jdk1.8.0_202:/opt/module/jdk/jdk1.8.0_202
      - /opt/module/maven/apache-maven-3.9.2:/opt/module/maven/apache-maven-3.9.2
  1. 启动 Jenkins
bash 复制代码
docker-compose -f jenkins.yaml up -d
相关推荐
raoxiaoya2 小时前
同时安装多个版本的golang
开发语言·后端·golang
考虑考虑4 小时前
go使用gorilla/websocket实现websocket
后端·程序员·go
李少兄4 小时前
解决Spring Boot多模块自动配置失效问题
java·spring boot·后端
Piper蛋窝5 小时前
Go 1.19 相比 Go 1.18 有哪些值得注意的改动?
后端
码农BookSea5 小时前
不用Mockito写单元测试?你可能在浪费一半时间
后端·单元测试
codingandsleeping6 小时前
Express入门
javascript·后端·node.js
ss2736 小时前
基于Springboot + vue + 爬虫实现的高考志愿智能推荐系统
spring boot·后端·高考
专注API从业者7 小时前
《Go 语言高并发爬虫开发:淘宝商品 API 实时采集与 ETL 数据处理管道》
开发语言·后端·爬虫·golang
Asthenia04127 小时前
Netty writeAndFlush与Pipeline深入分析
后端
欧先生^_^8 小时前
Scala语法基础
开发语言·后端·scala