我用视频演播室制作了一个多克书。 视力演播室只进行罚款,现在Im试图从视窗本身建造这种节目(docker Building .
,我尝试了许多组合。 然而,我有以下错误:
> [build 3/7] COPY [client/client.csproj, client/]:
------
failed to compute cache key: "/client/client.csproj" not found: not found
当我改为<代码>时,csproj 它仍在继续,然后我收到:
=> ERROR [build 7/7] RUN dotnet build "client.csproj" -c Release -o /app/build 3.3s
------
> [build 7/7] RUN dotnet build "client.csproj" -c Release -o /app/build:
#15 0.652 Microsoft (R) Build Engine version 16.8.3+39993d9d for .NET
#15 0.652 Copyright (C) Microsoft Corporation. All rights reserved.
#15 0.652
#15 1.169 Determining projects to restore...
#15 1.483 All projects are up-to-date for restore.
#15 3.231 CSC : error CS5001: Program does not contain a static Main method suitable for an entry point [/src/client/client.csproj]
#15 3.240
#15 3.240 Build FAILED.
#15 3.240
#15 3.240 CSC : error CS5001: Program does not contain a static Main method suitable for an entry point [/src/client/client.csproj]
#15 3.240 0 Warning (5)
#15 3.240 1 Error (5)
#15 3.240
#15 3.240 Time Elapsed 00:00:02.51
-----
executor failed running [/bin/sh -c dotnet build "client.csproj" -c Release -o /app/build]: exit code: 1
我做了什么错误? 我将多克赖特改为Windows,修改了WSL,并重新启动了所有工作。
#See https://aka.ms/containerfastmode to understand how Visua...
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
WORKDIR /src
COPY ["client/client.csproj", "client/"]
RUN dotnet restore "client/client.csproj"
COPY . .
WORKDIR "/src/client"
RUN dotnet build "client.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "client.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet , "client.dll"]