je suis en train d'installer un projet asp.net dans docker. Cependant, j'ai quelques problèmes lors de la création de l'image Docker.
C'est un projet ASP.net core 5.0.
Voici le dockerFile (généré par visual studio):
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["MonProjet.csproj", "MonProjet/"]
RUN dotnet restore "MonProjet/MonProjet.csproj"
COPY . .
WORKDIR "/src/MonProjet"
RUN dotnet build "MonProjet.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "MonProjet.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MonProjet.dll"]
> [build 7/7] RUN dotnet build "MonProjet.csproj" -c Release -o /app/build:
#15 0.740 Microsoft (R) Build Engine version 16.10.2+857e5a733 for .NET
#15 0.740 Copyright (C) Microsoft Corporation. All rights reserved.
#15 0.740
#15 1.398 Determining projects to restore...
#15 1.825 All projects are up-to-date for restore.
#15 5.343 CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/src/MonProjet/MonProjet.csproj]
#15 5.362
#15 5.362 Build FAILED.
#15 5.362
#15 5.363 CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/src/MonProjet/MonProjet.csproj]
#15 5.363 0 Warning(s)
#15 5.363 1 Error(s)
#15 5.363
× Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
× Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.