echo 删除项目目录rm -rf /home/code/vueDotNetCore-OpenSourceecho 创建项目目录mkdir /home/code/vueDotNetCore-OpenSourceecho 克隆源代码git clone https://github.com/ZhengHengWU/vue-dotNetCor...
echo '>>>删除项目目录' rm -rf /home/code/vueDotNetCore-OpenSource echo '>>>创建项目目录' mkdir /home/code/vueDotNetCore-OpenSource echo '>>>克隆源代码' git clone https://github.com/ZhengHengWU/vue-dotNetCore-Demo.git /home/code/vueDotNetCore-OpenSource echo '执行dotnet编译发布' dotnet restore /home/code/vueDotNetCore-OpenSource/dotNetCoreApi dotnet build /home/code/vueDotNetCore-OpenSource/dotNetCoreApi dotnet publish /home/code/vueDotNetCore-OpenSource/dotNetCoreApi -o /home/publish/dotNetApi echo '>>>获取旧的容器id' CID=$(docker ps |grep "dotnetapicontains" |awk '{print $1}') echo $CID echo '>>>停止旧的容器' if [ "$CID" != "" ];then docker stop $CID echo '>>>删除旧的容器' docker rm $CID fi echo '>>>获取旧的镜像' IID=$(docker images |grep "dotnetapi" |awk '{print $3}') echo $IID if [ "$IID" != "" ];then echo '>>>删除旧的镜像' docker rmi $IID fi echo '构建docker镜像' docker build -t dotnetapi /home/publish/dotNetApi sleep 10 echo '>>>启动新的容器' docker run -d -p 5002:5002 --name dotnetapicontains dotnetapi
沃梦达教程
本文标题为:Docker部署ASP.NET Core应用到Linux中bash脚本
基础教程推荐
猜你喜欢
- C#控制台实现飞行棋小游戏 2023-04-22
- ZooKeeper的安装及部署教程 2023-01-22
- C#类和结构详解 2023-05-30
- C# 调用WebService的方法 2023-03-09
- C# windows语音识别与朗读实例 2023-04-27
- unity实现动态排行榜 2023-04-27
- C# List实现行转列的通用方案 2022-11-02
- winform把Office转成PDF文件 2023-06-14
- linux – 如何在Debian Jessie中安装dotnet core sdk 2023-09-26
- 一个读写csv文件的C#类 2022-11-06