11
votes

I'm trying to run an .NET Core app on my mac. I'm using VS Core and upgraded the project to .NET 1.1. Everything works fine when I run it through VSCode however when I get to run it using Docker it fails.

I do the following steps:

dotnet publish -c Release -o out
docker build -t myApp .

The Dockerfile looks like this:

FROM microsoft/dotnet:1.1.0-preview1-runtime
WORKDIR /service
COPY out ./service/
ENTRYPOINT ["dotnet", "myApp.dll"]

Essentially I'm following the steps from https://github.com/dotnet/dotnet-docker . I'm getting all the time the following error:

Did you mean to run dotnet SDK commands? Please install dotnet SDK from: http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409

I'm not sure what I am missing here...

1
Is your application called myApp?Roman
I found what happened. My WORKDIR was /service however I was copying everything to ./service/ so when I ran myApp.dll wasn't finding it. A bit of a wrong error message in my opinion. I changed the dockerfile to do: COPY out ./ and everything workedCarlos Torrecillas
dotnet was probably not seeing the dll you were specifying and assuming you were trying to run one of the SDK commands.Roman
Yes, that's what I think - thanks!Carlos Torrecillas
at the moment, it's also 100% strict on having only "dll" after the first dot in your entrypoint assemblynik.shornikov

1 Answers

5
votes

I changed my dockerfile to have the following COPY statement:

COPY out ./

That then made the entrypoint to work because it was then able to find out myApp.dll. I think the message could be improved here, but that's me assuming that's what happened