From 4550a677db2bb2b33fcc7389c0139c1b36994662 Mon Sep 17 00:00:00 2001 From: aoshiguchen <1052045476@qq.com> Date: Wed, 26 Jul 2023 10:11:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E9=95=9C=E5=83=8Fbuild=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/unix/client_docker_build.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/unix/client_docker_build.sh b/scripts/unix/client_docker_build.sh index 50199979..b077caeb 100644 --- a/scripts/unix/client_docker_build.sh +++ b/scripts/unix/client_docker_build.sh @@ -5,6 +5,19 @@ ImageVer=1.8.5 ImageName=neutrino-proxy-client DockerFilePath=$PWD/../../neutrino-proxy-client/Dockerfile +deployDir=$PWD/../../"deploy" +clientDeployDir=$deployDir"/client" + +#切到项目根目录 +#初始化文件夹 +if [ ! -d "$deployDir" ];then + mkdir $deployDir +fi +if [ ! -d "$clientDeployDir" ];then + mkdir $clientDeployDir +fi +rm -rf $clientDeployDir/$ImageName.tar + #echo '打包jar...' sh ./client_build.sh @@ -12,4 +25,5 @@ sh ./client_build.sh docker rmi -f $(docker images | grep $ImageName | awk '{print $3}') # 构建镜像 docker build -t $ImageName:$ImageVer -t $ImageName:latest -f $DockerFilePath $PWD/../.. - +# 保存镜像到本地 +docker save -o $clientDeployDir/$ImageName.tar $ImageName:$ImageVer