1 回答

TA貢獻(xiàn)1757條經(jīng)驗(yàn) 獲得超8個(gè)贊
您的存儲(chǔ)庫中存在多個(gè)問題:
清理您的項(xiàng)目,
Jenkins.sln and Jenkins.csproj
您的項(xiàng)目中有多個(gè)級(jí)別。刪除無用的內(nèi)容。我和你做了一個(gè)測(cè)試
JenkinsPipeLine\Jenkins\Jenkins
對(duì)于 中的 dockerfile
JenkinsPipeLine\Jenkins\Jenkins
,它的鏡像是錯(cuò)誤的,你的項(xiàng)目目標(biāo)netcoreapp2.1
,你的鏡像應(yīng)該是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"]
運(yùn)行命令docker build -t jenkins -f Dockerfile .從JenkinsPipeLine\Jenkins\Jenkins
- 1 回答
- 0 關(guān)注
- 157 瀏覽
添加回答
舉報(bào)