CentOS 7 搭建Jenkins + Docker系统

时间:2024-10-31 01:18:37

1、首先准备一台CentOS服务器,最好能2核+4G以上配置。为了保证Jenkins与Docker能够顺利安装上,首先更新系统:yum -y update。下图表示系统已经是最新版本了。

CentOS 7 搭建Jenkins + Docker系统

3、使用以下命令安装Jenkins:yum install -y jenkins

CentOS 7 搭建Jenkins + Docker系统CentOS 7 搭建Jenkins + Docker系统CentOS 7 搭建Jenkins + Docker系统

7、测试Jenkins。新建一个自由风格的job, 在job的执行阶段分别执行以下脚本:1. 拉取wordpress和mysql镜像2. 启动mysql容器3. 启动wordpress容器

CentOS 7 搭建Jenkins + Docker系统CentOS 7 搭建Jenkins + Docker系统

8、最后执行job, job执行结束,在浏览器里直接访问http://localhost/,可以看到wordpress已经可以使用了。

CentOS 7 搭建Jenkins + Docker系统CentOS 7 搭建Jenkins + Docker系统
© 2025 长短途
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com