优化jenkins镜像

This commit is contained in:
KennyLee 2019-06-06 11:46:36 +08:00
parent 8247a3b76d
commit be515d30c1
6 changed files with 20 additions and 8 deletions

View File

@ -1,4 +1,4 @@
FROM registry.docker:5000/timekey/python
FROM python
MAINTAINER kennylee26 <kennylee26@gmail.com>

View File

@ -18,7 +18,10 @@ ARG agent_port=50000
VOLUME /var/jenkins_home
USER root
RUN sed -i 's/archive.ubuntu.com/mirrors.163.com/g' /etc/apt/sources.list
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak
COPY stretch.sources.list /etc/apt/sources.list
RUN apt-get -y update
# recommend
RUN apt-get install -y \

View File

@ -1,14 +1,15 @@
# Jenkins
由于一些极端情况,不能联网,所以默认情况是使用本地的 `image` 如果非这样的情况docker-compose文件可改为 `build .`
基于官方 https://hub.docker.com/_/jenkins 镜像构建的mirror做了本地化的一些提速修改。
## 使用
基础镜像构建命令
本地构建命令
```
docker build -t timekey/jenkins:2.19.3 .
docker build -t kennylee26/jenkins .
```
默认管理员账号密码 `admin/111111`
安装其实不是大问题问题比较大的由于网络问题而导致各种plugin安装不上最后只能一个一个的下载到本地再进行安装痛苦。所以如非必要不建议随便升级或者除非时间特别充裕吧。
>注: jenkins安装插件比较痛苦因为各种网络问题导致lugin安装不上。这时可以一个一个的下载到本地再进行安装。而一般jenkins升级后插件也需要升级才能使用所以不建议随便升级等时间特别充裕再弄吧。

View File

@ -0,0 +1,8 @@
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb http://mirrors.aliyun.com/debian-security stretch/updates main
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib

View File

@ -1,5 +1,5 @@
<VirtualHost *:80>
ServerName git.timekey.com.cn
ServerName git.kennylee.cn
DocumentRoot /home/git
SetEnv GIT_PROJECT_ROOT /home/git

View File

@ -5,7 +5,7 @@ Docker Registry v2的docker-compose启动文件
证书命令参考:
openssl req -x509 \
-subj "/C=CN/ST=BeiJing/L=Dongcheng/CN=docker.timekey.com.cn" \
-subj "/C=CN/ST=BeiJing/L=Dongcheng/CN=docker.kennylee.cn" \
-nodes -days 3650 -newkey rsa:2048 -keyout server.key -out server.pem
openssl x509 -outform der -in server.pem -out server.crt