jenkins容器安装
# 安装的dockerfile
FROM jenkins/jenkins:2.332.3
USER root
RUN echo '' > /etc/apt/sources.list \
&& echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free" > /etc/apt/sources.list \
&& echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list \
&& echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free" >> /etc/apt/sources.list \
&& echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free" >> /etc/apt/sources.list \
&& apt update \
&& apt install sudo -y \
&& apt install vim -y \
&& apt install sshpass -y \
&& apt install python -y \
&& sed -i '27a\jenkins ALL=(ALL) NOPASSWD:ALL' /etc/sudoers
USER jenkins
ENV LANG C.UTF-8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# docker-compose文件
version: '3'
services:
jenkins:
image: di.zzppjj.top/library/jenkins:v6
container_name: jenkins
restart: always
ports:
- '8000:8080'
- '50000:50000'
environment:
JAVA_OPTS: -Duser.timezone=Asia/Shanghai
extra_hosts:
- "di.zzppjj.top:172.16.30.215"
volumes:
- /data/jenkins/jenkins_home:/var/jenkins_home
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- /data:/data
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
上次更新: 2023/02/23, 18:13:16