且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ASP.NET 5:使用多项目解决方案构建Docker

更新时间:2022-03-22 05:41:16

可能迟到了,但我要回答这个对于那些仍然试图让它工作的人的问题。您需要在解决方案级别上创建一个Docker文件。然后,您需要更新您的工作文件夹以使用Web项目所在的文件夹。以下是最终的Docker文件,考虑到 kpm k 功能被替换为一个 dotnet 工具。

It might be late, but I'm going to answer this question for those who are still trying to get it working. You need to create a Dockerfile on solution level. Then you need to update your working folder to use the one where you web project is located. Here is below the final Dockerfile taking in account that kpm and k utilites were replaced with one dotnet tool.

FROM microsoft/dotnet:latest

COPY . /app
WORKDIR /app/src/QuizzCorrector
RUN ["dotnet", "restore"]

EXPOSE 5004
ENTRYPOINT ["dotnet", "run"]