From 48b348d48083b3a97be592cf072516c3037aa051 Mon Sep 17 00:00:00 2001 From: waynaqua <166974380@qq.com> Date: Wed, 9 Jun 2021 13:01:55 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=95=86=E5=9F=8E):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0docker=E9=83=A8=E7=BD=B2=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker_install.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docker_install.sh diff --git a/docker_install.sh b/docker_install.sh new file mode 100644 index 0000000..1541ac4 --- /dev/null +++ b/docker_install.sh @@ -0,0 +1,21 @@ +# /bin/bash +# waynboot-mall项目得docker方式部署脚本 + +app_name="waynboot_mall" +docker_redistry_prefix="registry.cn-shanghai.aliyuncs.com/wayn111/" +waynboot_mall=("waynboot-mobile-api:82" "waynboot-admin-api:81" "waynboot-message-consumer:85") + +for var in "${waynboot_mall[@]}"; do + echo "${var}:初始化安装开始" + port=${var#*:} + name=${var%:*} + docker stop ${name} + docker rm ${name} + docker rmi "${docker_redistry_prefix}${name}" + docker pull "${docker_redistry_prefix}${name}" + docker run -d -p ${port}:${port} --net=host --name ${name} "${docker_redistry_prefix}${name}" + echo "${var}:初始化安装结束" + echo "------------------------------------------------------------------" +done + +echo "${app_name}项目安装成功"