aspnet / aspnet-docker

[Archived] ASP.NET Core Docker images for 1.x. Go to https://github.com/dotnet/dotnet-docker for 2.1 and up.
https://asp.net
719 stars 171 forks source link

Container exists imemdiately with an error #423

Closed kharesiddharth closed 6 years ago

kharesiddharth commented 6 years ago

Guys , trying to create an image for very simple asp.net mvc core app . however container exits immediately with this error . Did you mean to run dotnet SDK commands? Please install dotnet SDK from: http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409 Docker file: FROM microsoft/aspnetcore:1.1.1

COPY dist /app

WORKDIR /app

EXPOSE 80/tcp

ENTRYPOINT [“dotnet”, “ExampleApp.dll”]

this mvc project is built using .net core 1.1 . i checked in csproj properties dist folders exists and there is a dll with this name exampleapp.dll . its in lower case unlike my docker file . i tried changing case in docker file to match with exactly dll name case . did not help docker image creation messages are below -

C:\ExampleApp>docker build . -t apress/exampleapp -f dockerfile Sending build context to Docker daemon 32.62MB Step 1/5 : FROM microsoft/aspnetcore:1.1.1 —> 51d6c2e2970c Step 2/5 : COPY dist /app —> 0cd2a978f10f Step 3/5 : WORKDIR /app Removing intermediate container 7120bc31040c —> e4a361fdb93e Step 4/5 : EXPOSE 80/tcp —> Running in 67fdac0656bc Removing intermediate container 67fdac0656bc —> 9cb7d03e79b0 Step 5/5 : ENTRYPOINT [“dotnet”, “ExampleApp.dll”] —> Running in 29b587a65976 Removing intermediate container 29b587a65976 —> 3c399db8ab8f Successfully built 3c399db8ab8f Successfully tagged apress/exampleapp:latest SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have ‘-rwxr-xr-x’ permissions. It is recommended to double check and reset permissions for sensitive files and directories.

ofcourse if i run application from visual studio it compiles and works fine .

any input why container exits out imemdiatley? thanks siddharth

natemcmaster commented 6 years ago

It exits immediately because it can't find ExampleApp.dll. Double check your file casing. You can debug this better by chaning the entrypoint to a shell and try running dotnet ExampleApp.dll in interactive mode. docker run --rm -it --entrypoint sh my-image

kharesiddharth commented 6 years ago

running it interactive was very helpful . thank you