From d18c5d85e66f1af1f82e6d84aae72483e1106988 Mon Sep 17 00:00:00 2001 From: ShiChangzhou Date: Mon, 25 Sep 2023 17:50:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=89=88=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- push-op-ui.bat | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 push-op-ui.bat diff --git a/Dockerfile b/Dockerfile index 6dbf2b1..0025e9c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,3 @@ -FROM nginx:1.20-alpine +FROM 192.168.202.36:30002/library/nginx:1.20-alpine COPY default.conf /etc/nginx/conf.d/default.conf ADD dist /usr/share/nginx/html diff --git a/push-op-ui.bat b/push-op-ui.bat new file mode 100644 index 0000000..89edade --- /dev/null +++ b/push-op-ui.bat @@ -0,0 +1,27 @@ +@echo off +echo --------------------------------自定义参数,启动前先修改-------------------------------------- +set imageURI=192.168.202.36:30002/op-lanju/op-ui +::echo 获取当前日期字符串 +for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c +::echo 获取当前时间字符串 +for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b +::echo 如当前小时小于10,将空格替换为0 +set T=%T: =0% +::echo 显示输出日期时间字符串 +set imageVersion=%D%%T% +::输出发版信息 +echo 镜像库地址:%imageURI% +echo 镜像版本:%imageVersion% +echo --------------------------------执行打包-------------------------------- +call npm run build:prod + +dir +echo --------------------------------docker login...------------------------------- +docker login 192.168.202.36:30002 -u deploy -p Deploy@2023 +echo --------------------------------docker build...------------------------------- +docker build -t %imageURI%:%imageVersion% . +echo --------------------------------docker push...-------------------------------- +docker push %imageURI%:%imageVersion% +@pause + +::docker pull 192.168.3.157:8001/library/nginx:1.20-alpine \ No newline at end of file