user5475280
user5475280

Reputation:

How to install dotnetcore in windowsservercore docker container

I have C++ application and it is running via ASP.NET Core application. The C++ application is x86 based, so it is not running in aspnetcore:2.0-nanoserver images.

I read about nanoserver containers and it supports x64 based application. I am unable to build my C++ application as it has dependencies with x86 libraries.

So I use windowsservercore images, which supports both x86 and x64 applications. Tested my C++ application in container commandline and it is working fine.

But this image does not have dotnetcore installed, so please let me know how to install dotnetcore in windowsservercore container. Suggest me windowsservercore image with dotnetcore.

Upvotes: 5

Views: 3593

Answers (1)

Chris F Carroll
Chris F Carroll

Reputation: 12360

If you have Docker installed and working on your desktop, then it is not hard to create your own docker image that will install dotnetcore onto a windows server image. Something very like this should serve your purpose:

FROM microsoft/iis:windowsservercore
COPY dotnet-runtime-2.0.4-win-x64.exe C:\
RUN C:\dotnet-runtime-2.0.4-win-x64.exe /quiet /install

Interpret this dockerfile as

  1. Start with the windowsservercore image
  2. Copy dotnet-runtime-2.0.4-win-x64.exe into the image
  3. Run it.
  4. Save the result as my docker image.

In order to make this work you should

It's worth an hour of your time to go through the tutorial on making Dockerfiles.

Upvotes: 7

Related Questions