Я пытаюсь создать образ докера для основного приложения dotnet в Windows, которое я планирую разместить на Kubernetes
со следующими сведениями
#docker file
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 8989
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["amazing-app.csproj", "amazing-app/"]
RUN dotnet restore "amazing-app/amazing-app.csproj"
COPY . .
WORKDIR "/src/amazing-app"
RUN dotnet build "amazing-app.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "amazing-app.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "amazing-app.dll"]
Структура каталога >> >>1006 *
![enter image description here](https://i.stack.imgur.com/eB3af.png)
После запуска docker build -t amazing-app-one .
Я получаю следующую ошибку на шаге 10/16. Приложение собирается и запускается локально, но Docker не может создать из него образ.
$> <Path>\amazing-app>docker build -t amazing-app-one .
Sending build context to Docker daemon 5.741MB
Step 1/16 : FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
---> 08096137b740
Step 2/16 : WORKDIR /app
---> Running in 14f5f9b7b3e5
Removing intermediate container 14f5f9b7b3e5
---> ae4846eda3f7
Step 3/16 : EXPOSE 8989
---> Running in 0f464e383641
Removing intermediate container 0f464e383641
---> 6b855b84749e
Step 4/16 : FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
---> 9817c25953a8
Step 5/16 : WORKDIR /src
---> Running in 5a8fc99a3ecf
Removing intermediate container 5a8fc99a3ecf
---> 694d5063e8e6
Step 6/16 : COPY ["amazing-app.csproj", "amazing-app/"]
---> 450921f630c3
Step 7/16 : RUN dotnet restore "amazing-app/amazing-app.csproj"
---> Running in ddb564e875be
Restore completed in 1.81 sec for /src/amazing-app/amazing-app.csproj.
Removing intermediate container ddb564e875be
---> b59e0c1dfb4d
Step 8/16 : COPY . .
---> 695977f3b543
Step 9/16 : WORKDIR "/src/amazing-app"
---> Running in aa5575c99ce3
Removing intermediate container aa5575c99ce3
---> 781b4c552434
Step 10/16 : RUN dotnet build "amazing-app.csproj" -c Release -o /app/build
---> Running in 3a602c34b5a9
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 36.78 ms for /src/amazing-app/amazing-app.csproj.
CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/src/amazing-app/amazing-app.csproj]
Build FAILED.
CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/src/amazing-app/amazing-app.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:02.37
The command '/bin/sh -c dotnet build "amazing-app.csproj" -c Release -o /app/build' returned a non-zero code: 1
найти исходный код по ссылке github
Я что-то здесь упустил? любая помощь высоко ценится.