1 回答

TA贡献1757条经验 获得超8个赞
您的存储库中存在多个问题:
清理您的项目,
Jenkins.sln and Jenkins.csproj
您的项目中有多个级别。删除无用的内容。我和你做了一个测试
JenkinsPipeLine\Jenkins\Jenkins
对于 中的 dockerfile
JenkinsPipeLine\Jenkins\Jenkins
,它的镜像是错误的,你的项目目标netcoreapp2.1
,你的镜像应该是mcr.microsoft.com/dotnet/core/sdk:2.1
。dockerfile 是
FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o output
# Runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:2.1
WORKDIR /app
COPY --from=build-env /app/output .
ENTRYPOINT ["dotnet", "jenkins.dll"]
运行命令docker build -t jenkins -f Dockerfile .从JenkinsPipeLine\Jenkins\Jenkins
- 1 回答
- 0 关注
- 159 浏览
添加回答
举报