From ac3ac0c6d229383a3734c64cc5d91815738a2af3 Mon Sep 17 00:00:00 2001 From: iioter <535915157@qq.com> Date: Wed, 24 May 2023 22:39:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96dockerfile=E5=92=8C=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 ++++ auto-build-arm.sh | 28 ++++++++++------------------ auto-build.sh | 18 ++---------------- 3 files changed, 16 insertions(+), 34 deletions(-) diff --git a/Dockerfile b/Dockerfile index 573d5d8..06f2583 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,10 @@ RUN dotnet publish "IoTGateway.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app +COPY drivers /app/drivers/ +COPY 3d /app/wwwroot/3d/ +COPY IoTGateway/iotgateway.db /app/ +COPY IoTGateway/Quickstarts.ReferenceServer.Config.xml /app/ COPY --from=publish /app/publish . ENV TZ=Asia/Shanghai diff --git a/auto-build-arm.sh b/auto-build-arm.sh index 9331bc0..ffdd052 100644 --- a/auto-build-arm.sh +++ b/auto-build-arm.sh @@ -1,28 +1,20 @@ +#!/bin/bash echo start -tag="2.0.0" +tag="2.0.2" echo $tag -docker build -t iotgateway . - -docker stop iotgateway -docker rm iotgateway - -docker run -d --restart always --name iotgateway -p 518:518 -p 1888:1888 -p 62541:62541 -p 503:503 iotgateway - -docker cp 3d iotgateway:app/wwwroot/ -docker cp drivers iotgateway:app/ -docker cp IoTGateway/iotgateway.db iotgateway:app/ -docker cp IoTGateway/Quickstarts.ReferenceServer.Config.xml iotgateway:app/ - -docker restart iotgateway - -docker commit iotgateway registry.cn-hangzhou.aliyuncs.com/iotgateway/iotgateway:arm-$tag +docker build -t registry.cn-hangzhou.aliyuncs.com/iotgateway/iotgateway:arm-$tag . docker push registry.cn-hangzhou.aliyuncs.com/iotgateway/iotgateway:arm-$tag docker tag registry.cn-hangzhou.aliyuncs.com/iotgateway/iotgateway:arm-$tag registry.cn-hangzhou.aliyuncs.com/iotgateway/iotgateway:arm docker push registry.cn-hangzhou.aliyuncs.com/iotgateway/iotgateway:arm -docker tag registry.cn-hangzhou.aliyuncs.com/iotgateway/iotgateway:arm 15261671110/iotgateway:arm-$tag +docker tag registry.cn-hangzhou.aliyuncs.com/iotgateway/iotgateway:latest 15261671110/iotgateway:arm-$tag docker push 15261671110/iotgateway:arm-$tag -docker tag 15261671110/iotgateway:arm-$tag 15261671110/iotgateway:arm +docker tag 15261671110/iotgateway:$tag 15261671110/iotgateway:arm docker push 15261671110/iotgateway:arm + + + + + diff --git a/auto-build.sh b/auto-build.sh index b7e63c1..d4105a0 100644 --- a/auto-build.sh +++ b/auto-build.sh @@ -1,22 +1,8 @@ #!/bin/bash echo start -tag="2.0.0" +tag="2.0.2" echo $tag -docker build -t iotgateway . - -docker stop iotgateway -docker rm iotgateway - -docker run -d --restart always --name iotgateway -p 518:518 -p 1888:1888 -p 62541:62541 -p 503:503 iotgateway - -docker cp 3d iotgateway:app/wwwroot/ -docker cp drivers iotgateway:app/ -docker cp IoTGateway/iotgateway.db iotgateway:app/ -docker cp IoTGateway/Quickstarts.ReferenceServer.Config.xml iotgateway:app/ - -docker restart iotgateway - -docker commit iotgateway registry.cn-hangzhou.aliyuncs.com/iotgateway/iotgateway:$tag +docker build -t registry.cn-hangzhou.aliyuncs.com/iotgateway/iotgateway:$tag . docker push registry.cn-hangzhou.aliyuncs.com/iotgateway/iotgateway:$tag docker tag registry.cn-hangzhou.aliyuncs.com/iotgateway/iotgateway:$tag registry.cn-hangzhou.aliyuncs.com/iotgateway/iotgateway:latest