24 lines
1.2 KiB
Docker
24 lines
1.2 KiB
Docker
FROM jenkins/jenkins:2.492.3-lts-jdk21
|
|
|
|
USER root
|
|
|
|
# 使用国内镜像源加速(阿里云)
|
|
RUN rm -rf /etc/apt/sources.list.d/* \
|
|
&& echo "deb http://mirrors.aliyun.com/debian/ bookworm main non-free contrib" > /etc/apt/sources.list \
|
|
&& echo "deb http://mirrors.aliyun.com/debian-security bookworm-security main" >> /etc/apt/sources.list \
|
|
&& echo "deb http://mirrors.aliyun.com/debian/ bookworm-updates main non-free contrib" >> /etc/apt/sources.list
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y lsb-release ca-certificates curl && \
|
|
install -m 0755 -d /etc/apt/keyrings && \
|
|
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc && \
|
|
chmod a+r /etc/apt/keyrings/docker.asc && \
|
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
|
|
https://mirrors.tuna.tsinghua.edu.cn $(. /etc/os-release && echo \"$VERSION_CODENAME\") stable" \
|
|
| tee /etc/apt/sources.list.d/docker.list > /dev/null && \
|
|
apt-get update && apt-get install -y docker-ce-cli && \
|
|
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
USER jenkins
|
|
|
|
RUN jenkins-plugin-cli --plugins "blueocean docker-workflow" |