Created ASP .net Core Web Api project using Visual Studio 2022 with docker support for Windows.
Below was my docker file. It was auto generated when I enable docker support for Windows
FROM mcr.microsoft.com/dotnet/aspnet:3.1-nanoserver-1809 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
WORKDIR /src
COPY ["TestDocker/TestDocker.csproj", "TestDocker/"]
RUN dotnet restore "TestDocker/TestDocker.csproj"
COPY . .
WORKDIR "/src/TestDocker"
RUN dotnet build "TestDocker.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "TestDocker.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "TestDocker.dll"]
After deployed to Azure App Service Window container, it keep showing me unable to start the container.
After checking from App Service Kudu, found these error message in console logs:
24/05/2022 16:39:32.107 STDERR - Site: simpleDocker123 - [c67b2a5f07c12c44b98311303842a244ec416eea0432e0f0fcbe9218dc1be242] - https://aka.ms/dotnet-download
24/05/2022 16:40:05.113 STDERR - Site: simpleDocker123 - [aa0bab045680844de048b1f7c158f88d53585d531484bb3f1030800731b56ecb] - It was not possible to find any installed .NET Core SDKs
24/05/2022 16:40:05.113 STDERR - Site: simpleDocker123 - [aa0bab045680844de048b1f7c158f88d53585d531484bb3f1030800731b56ecb] - Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
24/05/2022 16:40:05.113 STDERR - Site: simpleDocker123 - [aa0bab045680844de048b1f7c158f88d53585d531484bb3f1030800731b56ecb] - https://aka.ms/dotnet-download
24/05/2022 16:42:51.232 STDERR - Site: simpleDocker123 - [29a2d2d08e27bb6852608a4b2ac116a55bf011c19bdfc4278e069aa368d76c66] - It was not possible to find any installed .NET Core SDKs
24/05/2022 16:42:51.232 STDERR - Site: simpleDocker123 - [29a2d2d08e27bb6852608a4b2ac116a55bf011c19bdfc4278e069aa368d76c66] - Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
24/05/2022 16:42:51.232 STDERR - Site: simpleDocker123 - [29a2d2d08e27bb6852608a4b2ac116a55bf011c19bdfc4278e069aa368d76c66] - https://aka.ms/dotnet-download
On platform logs was something as below:
24/05/2022 16:51:39.528 INFO - Site: simpleDocker123 - [e30858fffca0b25a8280722958eb413a87299c1422cf713f786e8ae839a5091a] - Start container succeeded.
24/05/2022 16:51:45.822 INFO - Site: simpleDocker123 - [e30858fffca0b25a8280722958eb413a87299c1422cf713f786e8ae839a5091a] - Container has started.
24/05/2022 16:51:45.822 INFO - Site: simpleDocker123 - [e30858fffca0b25a8280722958eb413a87299c1422cf713f786e8ae839a5091a] - Customizing the container
24/05/2022 16:51:47.053 INFO - Site: simpleDocker123 - [e30858fffca0b25a8280722958eb413a87299c1422cf713f786e8ae839a5091a] - Container customization has completed successfully
24/05/2022 16:51:47.067 INFO - Site: simpleDocker123 - [e30858fffca0b25a8280722958eb413a87299c1422cf713f786e8ae839a5091a] - Container has started.
24/05/2022 16:51:47.836 INFO - Site: simpleDocker123 - [e30858fffca0b25a8280722958eb413a87299c1422cf713f786e8ae839a5091a] - Container entrypoint has started
24/05/2022 16:52:08.890 ERROR - Site: simpleDocker123 - [e30858fffca0b25a8280722958eb413a87299c1422cf713f786e8ae839a5091a] - Container entrypoint is no longer running.
24/05/2022 16:52:08.890 ERROR - Site: simpleDocker123 - [e30858fffca0b25a8280722958eb413a87299c1422cf713f786e8ae839a5091a] - Container was not ready because it has been cancelled or exited
24/05/2022 16:52:08.890 INFO - Site: simpleDocker123 - [e30858fffca0b25a8280722958eb413a87299c1422cf713f786e8ae839a5091a] - Attempting to stop container: e30858fffca0b25a8280722958eb413a87299c1422cf713f786e8ae839a5091a. Site simpleDocker123
24/05/2022 16:52:08.947 INFO - Site: simpleDocker123 - [e30858fffca0b25a8280722958eb413a87299c1422cf713f786e8ae839a5091a] - Shutdown container: e30858fffca0b25a8280722958eb413a87299c1422cf713f786e8ae839a5091a
Any idea on this issue? Already followed the guide from microsoft exactly but still hitting these error
Any help will be appreciate
Thanks