0

I am trying to run locally on Windows Desktop a micro service in Docker (Windows Desktop Docker) and my docker file content is as below:

FROM mcr.microsoft.com/dotnet/core/aspnet:3.0
WORKDIR /app
COPY . .
EXPOSE 80
ENTRYPOINT ["dotnet", "ScheduleService.dll"]

when i issue docker run command to expose port 8081:80 using the following command, the container exits automatically. the run command being issued on Powershell is as below:

docker run -d -p 8081:80 schedule

When i check the docker using docker ps -a command i get the following output:

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                              PORTS               NAMES
8d2869a886f9        schedule            "dotnet ScheduleServ…"   7 seconds ago       Exited (2147516561) 4 seconds ago                       gracious_joliot
f2c7e9b43b0b        schedule            "dotnet ScheduleServ…"   19 hours ago        Exited (2147516561) 19 hours ago                        pedantic_cerf

It says Exited. can anyone help me on this.

user9308317
  • 1
  • 1
  • 2
  • 1
    check the logs `docker logs ` where container-id can be retrieved from docker ps output. – mchawre Sep 23 '19 at 10:03
  • https://github.com/Microsoft/vscode/issues/6312 check this out – Dusan Gligoric Sep 23 '19 at 10:04
  • Just drop the `-d` parameter and check what's printed out. – bellackn Sep 23 '19 at 10:29
  • Possible duplicate of [Why docker container exits immediately](https://stackoverflow.com/questions/28212380/why-docker-container-exits-immediately) – thibaultbl Sep 23 '19 at 12:14
  • @bellackn on removing -d and issuing command docker run -p 8081:80 schedule, the following message is printed, i guess some issue with ASP .NET Core 3 which I am using in dockerfile: It was not possible to find any installed .NET Core SDKs Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from: https://aka.ms/dotnet-download – user9308317 Sep 23 '19 at 15:10
  • Then you've got a detailed answer on what's going wrong. :) – bellackn Sep 23 '19 at 15:32
  • @bellackn thanks a lot. I guess this error due to final version of .NET core 3.0 still not released and published as Docker image. However how do i spin a docker container for aspnet core 3.0. Do we have to wait till the final release of .net core 3.0 – user9308317 Sep 23 '19 at 15:56

0 Answers0