Problem: Unhandled exception. System.DllNotFoundException: Unable to load shared library 'MklImports' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libMklImports: cannot open shared object file: No such file or directory.
Solution: If you are trying to host a none supervised Machine Learning application that can train itself on a timely basis in a docker container and you experience the error above, try the following solution:
1. Make sure that you are not producing an exe application (An application with an exe file extension) as this will not run in a Linux Based Docker Image. The error might happen if you have an Entry-Point defined as "YourApplication.dll" in your Dockerfile hence you produce an exe based application and expect that to run in a Linux based Docker Image.
2. Make sure that if you trying to run a Machine-Learning application in a Linux based Docker Container, that all dependencies needed to run the application are all copied to the published folder. The error might be due to one of the dependency missing or not getting copied to the publish folder.
3. make sure that your application outputs a Console Application (If this application is intended to run as a stand-alone application to train the Machine-Learning Modal). Right-click on your project (not your solution but the second application), then click on "Properties", on the left-hand side menu, click on "Application" then make sure that the "Output type" is set to "Console Application".
4. If you are packaging your Machine-Learning Application to run in seperated Docker Container as a standalone application, remember that the library called libiomp5.so is not available for applications runnng in Linux Docker Container.
This library is only available if you are running your application on Windows based Docker Containers, in order to get this library dependecy for a Machine Learning application to run successfully, install the Intel MKL library dependecy on the Host Linux machine then find the location of libiomp5.so file and copy it to application folder.
- Verify that the library is indeed copied to the folder where the application files are then rebuild your image.
[NB] The libiomp4.so is required to run the ML.Net Machine-Learning application in Docker Linux based container. Follow the instruction from Microsoft Documentation to correctly install the MKL repository.
Hi, Do you have to install .Net in Docker Container?
Jack said:
Hi, Vir, No you do not have to install .Net in Docker Container. When you pull .Net Runtime Image everything comes with it.