FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 8000 EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY ["Crontab/Crontab.csproj", "Crontab/"] COPY ["CrontabService/CrontabService.csproj", "CrontabService/"] COPY ["Common/Common.csproj", "Common/"] RUN dotnet restore "Crontab/Crontab.csproj" COPY . . WORKDIR "/src/Crontab" RUN dotnet build "Crontab.csproj" -c Release -o /app/build
FROM build AS publish RUN dotnet publish "Crontab.csproj" -c Release -o /app/publish
FROM base AS final WORKDIR /app COPY . ./ ENTRYPOINT ["dotnet", "Crontab.dll"] 以上是我的dockerfile文件 失败原因如下 Step 7/19 : COPY ["./Crontab/Crontab.csproj", "Crontab/"] COPY failed: stat /var/lib/docker/tmp/docker-builder806754089/Crontab/Crontab.csproj: no such file or directory 如果放在和目录同级问题是 Step 7/19 : COPY ["Crontab/Crontab.csproj", "/src"] COPY failed: Forbidden path outside the build context: Crontab/Crontab.csproj () 此时我将dockerfile挪到上一个文件夹也是失败,
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。