I'm creating a simple dotnetcore 2.0 application and I want to containerize it. The idea being this container will run once on deployment to do some application configuration tasks.
At present, the code just does this...
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
The docker file looks like this...
FROM microsoft/dotnet:2.0-runtime
ARG source
WORKDIR /app
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "consoleapp.dll"]
I hit F5 in Visual Studio 2017 and I can see by doing a docker image ls
command that the container exists.
I then attempt to run the container as follows:
docker run consoleapp: dev
I now get the error:
Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
My thinking on this is that because I am using a runtime image to base my image on, I should be able to somehow start my application. I'm guessing the error here is that dotnet
which forms part of my entry point is part of the dotnet SDK and hence is not in my base image.
Should I base this container on a non-runtime version of the dotnet core?