feat: docker 构建失败问题解决,及docker构建文档

This commit is contained in:
fengxian.guo
2024-12-21 08:37:10 +08:00
parent 07a5b69511
commit 2cd8b73aa3
3 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
# Docker 构建说明
## 执行命令
```shell
# 在Yi.Abp.Net8 目录下执行
docker build -t xxx-xxx:${BUILD_NUMBER} -f ./src/Yi.Abp.Web/Dockerfile .
```
## 注意
NuGet 源国内访问有时候会报错,可以考虑切换成华为源,加上参数
```shell
RUN dotnet restore --source https://repo.huaweicloud.com/repository/nuget/v3/index.json "./src/Yi.Abp.Web/./Yi.Abp.Web.csproj"
RUN dotnet build --source https://repo.huaweicloud.com/repository/nuget/v3/index.json "./Yi.Abp.Web.csproj" -c $BUILD_CONFIGURATION -o /app/build
RUN dotnet publish --source https://repo.huaweicloud.com/repository/nuget/v3/index.json "./Yi.Abp.Web.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
```