首页 新闻 会员 周边 捐助

docker file ContainerBuildAndLaunch 任务意外失败

0
悬赏园豆:20 [待解决问题]

See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

设置编码格式

ENV LANG="zh_CN.UTF-8"
ENV LANGUAGE="zh_CN:zh"

设置时区为中国

ENV TZ=Asia/Shanghai
ENV DEBIAN_FRONTEND noninteractive

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["Dp.ArgCourse/Ya.ArgCourse.csproj", "Dp.ArgCourse/"]
COPY ["Dp.ArgCommon/DP.ArgComm.csproj", "Dp.ArgCommon/"]
COPY ["Dp.ArgRes/Dp.ArgRes.csproj", "Dp.ArgRes/"]
COPY ["Dp.ArgService/Dp.ArgService.csproj", "Dp.ArgService/"]
COPY ["Dp.ClsrRepos/Dp.ClsrRepos.csproj", "Dp.ClsrRepos/"]
RUN dotnet restore "Dp.ArgCourse/Ya.ArgCourse.csproj"
COPY . .
WORKDIR "/src/Dp.ArgCourse"
RUN dotnet build "Ya.ArgCourse.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Ya.ArgCourse.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Ya.ArgCourse.dll"]

HaoRudder的主页 HaoRudder | 初学一级 | 园豆:182
提问于:2022-12-05 19:06
< >
分享
所有回答(1)
0

本地发布项目,然后简化一下dockerfile放到发布后的文件夹里,重新build一下,试试
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
COPY . .
ENTRYPOINT ["dotnet", "Ya.ArgCourse.dll"]

顾星河 | 园豆:7294 (大侠五级) | 2022-12-06 09:16
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册