shimat / opencvsharp

OpenCV wrapper for .NET
Apache License 2.0
5.35k stars 1.15k forks source link

dockerization problem #953

Closed ffrankozz closed 3 years ago

ffrankozz commented 4 years ago

I am working on a Windows 10 pro m/c. I have used the latest OpenCVSharp libraries (4.3.0...) My, for instance, webapi with aspnetcore version 3.1 works perfectly. However when I create a linux docker container from the app and run it, it explodes spitting out "System.TypeInitializationException' occurred in OpenCvSharp.dll: 'The type initializer for 'OpenCvSharp.NativeMethods' threw an exception.'" message, on the first line it meets an OpenCVSharp call such as:

new Mat(100, 100, MatType.CV_8UC1, new Scalar(0));

Has anybody been able to run a linux container successfully so far from their OpenCVSharp4 application?

shimat commented 4 years ago

I think there is something wrong with the library dependencies, you can use ldd command to check dependencies of libOpenCvSharpExtern.so.

The Dockerfile I created may be helpful. https://github.com/shimat/opencvsharp/blob/master/docker/ubuntu.18.04-x64/Dockerfile

I am aware of the following problem, but I don't have a good solution. https://github.com/shimat/opencvsharp/issues/920

I run an application with OpenCvSharp on Linux Docker on Google AppEngine Flexible.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.