I am not sure how to debug container start process.
- I created a templated Blazor wasm hosted app (.NET 6) in VS 2022 and added docker support. Docker file configuration is default - I did not change anything in it
- I have pushed this image to docker hub.
- I have cleared all the images and containers from cache, docker images -a and docker ps -a return no data.
- I execute docker pull on both developmen computer (Win11) and ubuntu server.
- I run the container on both Win11 and ubuntu: docker run -dit -p 5000:80 username/imagename
- On Win11 container is running in the background, status: UP and I can access my app on localhost:5000
- However, on ubuntu container runs and exists (status: Exited (0) About 3 secs ago).
- docker logs containername returns no data
- docker inspect returns in config section: "Architecture": "amd64", "Os": "linux", "Entrypoint": [ "dotnet", "App.Server.dll" ] - so that looks OK
Dockerfile
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 ["TestApp/Server/TestApp.Server.csproj", "TestApp/Server/"]
COPY ["TestApp/Shared/TestApp.Shared.csproj", "TestApp/Shared/"]
COPY ["TestApp/Client/TestApp.Client.csproj", "TestApp/Client/"]
RUN dotnet restore "TestApp/Server/TestApp.Server.csproj"
COPY . .
WORKDIR "/src/TestApp/Server"
RUN dotnet build "TestApp.Server.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "TestApp.Server.csproj" -c Release -o
/app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "TestApp.Server.dll"]
Any ideas why I have different behavior on ubuntu server, and how can I debug this?