From 379cd4964651eb4de96ac63f9a03adeb6a7b657e Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 24 Mar 2026 16:02:33 +0800 Subject: [PATCH] =?UTF-8?q?pipeline-dev=20nerdctl=E6=96=B0=E5=A2=9Eaddress?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rc-auth/pipeline-dev | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rc-auth/pipeline-dev b/rc-auth/pipeline-dev index 4fad3858..c97061f9 100644 --- a/rc-auth/pipeline-dev +++ b/rc-auth/pipeline-dev @@ -17,6 +17,7 @@ pipeline { JAR_NAME = "rc-auth-*.jar" ALIYUN_REGISTRY = "registry.cn-hangzhou.aliyuncs.com/public_mirror_images" IMAGE_REP_TAG = "" + NERDCTL = "nerdctl --address /run/containerd/containerd.sock" DOCKER_FILE = "rc-auth/Dockerfile-dev" DOCKER_DIR = "rc-auth" K8S_NAMESPACE = "azizi" @@ -49,15 +50,15 @@ pipeline { usernameVariable: 'ALIYUN_USER', passwordVariable: 'ALIYUN_PASS' )]) { - sh 'echo $ALIYUN_PASS | nerdctl login --username $ALIYUN_USER --password-stdin registry.cn-hangzhou.aliyuncs.com' + sh 'echo $ALIYUN_PASS | $NERDCTL login --username $ALIYUN_USER --password-stdin registry.cn-hangzhou.aliyuncs.com' } - sh "nerdctl build --build-arg SERVICE_VERSION=${BUILD_IMAGE} -f ${DOCKER_FILE} -t ${IMAGE_REP_TAG} ${DOCKER_DIR}" + sh "${NERDCTL} build --build-arg SERVICE_VERSION=${BUILD_IMAGE} -f ${DOCKER_FILE} -t ${IMAGE_REP_TAG} ${DOCKER_DIR}" } } stage('Upload image') { steps { - sh "nerdctl push ${IMAGE_REP_TAG}" - sh "nerdctl rmi -f ${IMAGE_REP_TAG}" + sh "${NERDCTL} push ${IMAGE_REP_TAG}" + sh "${NERDCTL} rmi -f ${IMAGE_REP_TAG}" } } stage('Apply') {