Running in Docker

283 views
Skip to first unread message

manny...@level11.com

unread,
Oct 31, 2016, 7:52:57 PM10/31/16
to javacv
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.

Samuel Audet

unread,
Oct 31, 2016, 8:08:00 PM10/31/16
to jav...@googlegroups.com
It runs fine in Docker, yes, but you'll need to make sure to install at
least the C++ runtime. That's what the error is trying to tell you.

Samuel
Reply all
Reply to author
Forward
0 new messages