Home:ALL Converter>How to create docker image for dotnet app?

How to create docker image for dotnet app?

Ask Time:2020-10-09T19:34:43         Author:yatharth meena

Json Formatter

I have a dotnet project that work when i do dotnet run, i am trying to containerize that dotnet project. For that i have create the Dockerfile as below:

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1

COPY bin/Release/netcoreapp3.1/publish/ App/
WORKDIR /App

EXPOSE 5000

CMD ["dotnet", "MediatorAgent.dll"]

Before creating the docker image i did run dotnet publish -c Release. Now when i try to run this docker image, i am getting the below error

Unhandled exception. System.DllNotFoundException: Unable to load shared library 'indy' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libindy: cannot open shared object file: No such file or directory

I am following the instruction for Containerize a .NET Core app for creating docker image.

Author:yatharth meena,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/64279254/how-to-create-docker-image-for-dotnet-app
Stefan :

\nHow to create docker image for dotnet app?\n\nWell, you did it.\nWhat is likely to have gone wrong is that the DLL refered to as indy is not copied to the App folder.\nSince you are copying the data, please verify it's included in the original build at bin/Release/netcoreapp3.1/publish",
2020-10-09T11:38:20
yy