From 164c13cd9f7ff6b45b956c75630226eb055a01dd Mon Sep 17 00:00:00 2001 From: wangchuan Date: Wed, 31 Dec 2025 13:48:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3docker=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=90=8E=E8=8E=B7=E5=8F=96=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/apprun.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/apprun.sh b/backend/apprun.sh index 8ed4583..53711bb 100644 --- a/backend/apprun.sh +++ b/backend/apprun.sh @@ -55,7 +55,7 @@ has_docker() { # 判断是否存在当前应用的镜像 has_image() { - c=$(docker images|grep $IMAGE_NAME[[:blank:]]|wc -l) + c=$(docker images|grep $IMAGE_NAME|wc -l) if [ $c = 0 ] then return 1 @@ -65,7 +65,7 @@ has_image() { # 判断是否存在网络连接 checkOrCreate_network() { - c=$(docker network list|grep "${NETWORK_NAME}[[:blank:]]"|wc -l) + c=$(docker network list|grep "${NETWORK_NAME}"|wc -l) if [ $c = 0 ] then docker network create $NETWORK_NAME >/dev/null @@ -173,7 +173,7 @@ run() { mkdir -p $LOG_PATH fi stop_jar_run - latestImageId=$(docker images|grep $IMAGE_NAME[[:blank:]]|sort -r|head -1|awk '{OFS=":"}{print $1,$2}') + latestImageId=$(docker images|grep $IMAGE_NAME|sort -r|head -1|awk '{OFS=":"}{print $1}') echo "服务 $PROJECT_NAME 最新镜像ID为 $latestImageId" has_stop_container if [ $? = 0 ] @@ -292,7 +292,7 @@ version() { # 获取当前服务所存在的镜像版本 images() { has_docker - echo "当前使用镜像为:$(docker images|grep $IMAGE_NAME[[:blank:]]|awk '{OFS=":"}{print $1,$2}')" + echo "当前使用镜像为:$(docker images|grep $IMAGE_NAME|awk '{OFS=":"}{print $1}')" } case "$1" in