当前位置: 首页 > news >正文

docker方式启动Jenkins

docker方式启动Jenkins

1.启动命令

我已经打包好了文件,如下命令即可启动

docker run -d -v jenkins_home:/var/jenkins_home -p 8088:8080 -p 50000:50000 --restart=on-failure registry.cn-hangzhou.aliyuncs.com/devops_de/jenkins:lts-jdk17

还需要设置一下目录权限,要不然Jenkins用户无法写入

sudo chmod -R 777 /path/to/host/dir

1.1 docker-compose 方式启动

docker-compose.yaml文件如下

services:jenkins:image: registry.cn-hangzhou.aliyuncs.com/devops_de/jenkins:lts-jdk17ports:- "8088:8080"volumes:- jenkins_home:/var/jenkins_homessh-agent:image: registry.cn-hangzhou.aliyuncs.com/devops_de/ssh-agent:latest
volumes:jenkins_home:

注:未设置目录权限报错如下

​
[root@centos-1 ~]# docker logs -f f691a152dc6c
touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?

访问本地的8088端口

192.168.0.101:8088

2.查看密码

[root@centos-1 ~]# cat /data/jenkins_home/secrets/initialAdminPassword
b2543e8775344c4db4180e2bdfe39a68

3.登录查看

http://192.168.0.101:8089/

http://www.lryc.cn/news/574365.html

相关文章:

  • Python训练营---DAY56
  • C#串口通讯实战指南
  • RAW图像简单可视化以及png、jpg的区别
  • 设计模式 - 抽象工厂
  • AI智能体——MCP 模型上下文协议
  • 71-Oracle Undo与Flashback管理(Guarantee设置)深度解析
  • vue3+ELInput无法输入的问题
  • 传输层协议UDP
  • 服务器中集群防御和单机防御分别是指什么?
  • (cvpr2025) DefMamba: Deformable Visual State Space Model
  • github常用插件
  • Java编程中的设计模式:单例模式的深度剖析
  • EEG分类攻略2-Welch 周期图
  • Python 数据分析与可视化 Day 5 - 数据可视化入门(Matplotlib Seaborn)
  • Spring Boot使用MCP服务器
  • Flask框架index.html里引用的本地的js和css或者图片
  • EEG分类 - Theta 频带 power
  • C++ Vector 基础入门操作
  • QML革命:下一代GUI开发的核心优势详解
  • 论文笔记:Answering POI-Recommendation Questions using TourismReviews
  • 单片机——浮点数转换4位数码管显示
  • 【笔记】在Cygwin上使用mintty连接wsl
  • 1.2、CAN总线帧格式
  • Apache SeaTunnel Flink引擎执行流程源码分析
  • DeepSeek今天喝什么随机奶茶推荐器
  • 如何利用Charles抓包工具提升API调试与性能优化
  • 组件化设计核心:接口与实现分离(C++)
  • 拼团系统多层限流架构详解
  • 《去哪儿网Redis高并发实战:从问题定位到架构升级》
  • 边缘-云协同智能视觉系统:实时计算与云端智能的融合架构