首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >Docker 中构建 Jenkins1

Docker 中构建 Jenkins1

作者头像
franket
发布2022-01-21 10:07:17
发布2022-01-21 10:07:17
28900
代码可运行
举报
文章被收录于专栏:技术杂记技术杂记
运行总次数:0
代码可运行

创建Dockerfile

代码语言:javascript
代码运行次数:0
运行
复制
[root@docker build]# vim Dockerfile
[root@docker build]# cat Dockerfile 
FROM jenkins

#New plugins must be placed in the plugins file
COPY plugins /usr/share/jenkins/plugins

#The plugins.sh script will install new plugins
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins

#Copy private key and cert to image
COPY docker.crt /var/lib/jenkins/cert
COPY docker.key /var/lib/jenkins/pk

#Configure HTTP off and HTTPS on, using port 1973
ENV JENKINS_OPTS --httpPort=-1 --httpsPort=1973 --httpsCertificate=/var/lib/jenkins/cert --httpsPrivateKey=/var/lib/jenkins/pk
[root@docker build]# ll 
total 20
-rw------- 1 root root 1281 Jan 27 13:52 docker.crt
-rw------- 1 root root 1045 Jan 27 13:52 docker.csr
-rw-r--r-- 1 root root  497 Jan 27 14:13 Dockerfile
-rw------- 1 root root 1679 Jan 27 13:52 docker.key
-rw-r--r-- 1 root root   20 Jan 27 13:51 plugins
[root@docker build]# 

Note: Dockerfile plugins 还有两个证书文件 (docker.crt and docker.key) 必须在同一个目录里,包含 Dockerfile 的目录叫作构建环境,文件只有放在构建环境中才能在构建过程中被集成进去

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 创建Dockerfile
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档