简体   繁体   中英

How to create docker image for dotnet app?

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.

How to create docker image for dotnet app?

Well, you did it.

What is likely to have gone wrong is that the DLL refered to as indy is not copied to the App folder.

Since you are copying the data, please verify it's included in the original build at bin/Release/netcoreapp3.1/publish

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM