Has anybody successfully Dockerized a (Spring Boot) Java app using Javacv/opencv?
When running my app during development, I can only get it to run properly by specifying the opencv library path via LD_LIBRARY_PATH (i.e. java.library.path doesn't work). When I try the same thing in Docker, I get a failure:
Caused by: java.lang.UnsatisfiedLinkError: /tmp/javacpp79024134315554/libjniopencv_core.so: libstdc++.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1822)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:637)
... 58 more
I have tried setting both LD_LIBRARY_PATH and java.library.path in various ways (with ENV in the dockerfile, with "RUN export", etc.). Nothing seems to work. I seems like java finds the opencv-310.jar file but then opencv fails to load downstream .so libraries.