修改CICD的jenkins构建脚本

This commit is contained in:
zeaslity
2025-04-17 15:15:01 +08:00
parent ed9763f658
commit 56c79a02a8
3 changed files with 24 additions and 58 deletions

View File

@@ -1,6 +1,15 @@
FROM jenkins/jenkins:2.492.3-lts-jdk21
USER root
RUN apt-get update && apt-get install -y lsb-release ca-certificates curl && \
# 使用国内镜像源加速(阿里云)
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 && \
@@ -9,5 +18,7 @@ RUN apt-get update && apt-get install -y lsb-release ca-certificates curl && \
| 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"