You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi David, loved the standup about the minimal web api. It was really good.
How can you take the minimal webapi and put and run it in a Docker container? I tried it but get an error
#16 1.573 Microsoft (R) Build Engine version 17.0.0-preview-21378-03+d592862ed for .NET #16 1.573 Copyright (C) Microsoft Corporation. All rights reserved. #16 1.573 #16 3.747 Determining projects to restore... #16 4.436 All projects are up-to-date for restore. #16 4.740 You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview #16 10.34 CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/src/tradehelperapi/TradeHelper.Api.csproj] #16 11.24 #16 11.24 Build FAILED. #16 11.24 #16 11.24 CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/src/tradehelperapi/TradeHelper.Api.csproj] #16 11.24 0 Warning(s) #16 11.24 1 Error(s) #16 11.24 #16 11.24 Time Elapsed 00:00:09.39
Below is my Docker FIle
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["TradeHelper.Api/TradeHelper.Api.csproj", "tradehelperapi/"]
RUN dotnet restore "tradehelperapi/TradeHelper.Api.csproj"
COPY . .
WORKDIR "/src/"
RUN dotnet build "tradehelperapi/TradeHelper.Api.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "tradehelperapi/TradeHelper.Api.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "TradeHelper.Api.dll"]
The text was updated successfully, but these errors were encountered:
Hi David, loved the standup about the minimal web api. It was really good.
How can you take the minimal webapi and put and run it in a Docker container? I tried it but get an error
#16 1.573 Microsoft (R) Build Engine version 17.0.0-preview-21378-03+d592862ed for .NET
#16 1.573 Copyright (C) Microsoft Corporation. All rights reserved.
#16 1.573
#16 3.747 Determining projects to restore...
#16 4.436 All projects are up-to-date for restore.
#16 4.740 You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
#16 10.34 CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/src/tradehelperapi/TradeHelper.Api.csproj]
#16 11.24
#16 11.24 Build FAILED.
#16 11.24
#16 11.24 CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/src/tradehelperapi/TradeHelper.Api.csproj]
#16 11.24 0 Warning(s)
#16 11.24 1 Error(s)
#16 11.24
#16 11.24 Time Elapsed 00:00:09.39
Below is my Docker FIle
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["TradeHelper.Api/TradeHelper.Api.csproj", "tradehelperapi/"]
RUN dotnet restore "tradehelperapi/TradeHelper.Api.csproj"
COPY . .
WORKDIR "/src/"
RUN dotnet build "tradehelperapi/TradeHelper.Api.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "tradehelperapi/TradeHelper.Api.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "TradeHelper.Api.dll"]
The text was updated successfully, but these errors were encountered: