From 9d78ca95565a3404fe700ba3c238c25ad6f54b3e Mon Sep 17 00:00:00 2001 From: zk Date: Tue, 26 May 2026 21:40:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=20=20docker=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E7=8E=AF=E5=A2=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client-api/Dockerfile | 2 -- client-api/Jenkinsfile | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/client-api/Dockerfile b/client-api/Dockerfile index 8f172b4..66906c5 100644 --- a/client-api/Dockerfile +++ b/client-api/Dockerfile @@ -1,5 +1,3 @@ -# syntax=docker/dockerfile:1 - # ==================== 第一阶段:编译 ==================== FROM maven:3.8-openjdk-17 AS builder WORKDIR /build diff --git a/client-api/Jenkinsfile b/client-api/Jenkinsfile index 87b1851..44c6b09 100644 --- a/client-api/Jenkinsfile +++ b/client-api/Jenkinsfile @@ -73,6 +73,21 @@ pipeline { ' """ + // 配置 Docker 镜像加速器(国内环境必须) + sh """ + ${SSH_CMD} ' + if [ ! -f /etc/docker/daemon.json ] || ! grep -q registry-mirrors /etc/docker/daemon.json; then + echo "配置 Docker 镜像加速器..." + mkdir -p /etc/docker + echo "{\"registry-mirrors\":[\"https://mirror.ccs.tencentcloudapi.com\",\"https://docker.1ms.run\"]}" > /etc/docker/daemon.json + systemctl daemon-reload + systemctl restart docker + else + echo "Docker 镜像加速器已配置" + fi + ' + """ + // 检查 docker compose 插件(docker.io 自带 v2 插件) sh """ ${SSH_CMD} '