Create DL4J app on docker

Hi here,

is there a possibility to run a program on docker ?
Do I have to get a specific distribution of linux ? Debian (glibc) ?
Do I have to get an openJDK ?

Cheers,

Arnaud

@arnaud22 dl4j and its dependencies are just a library. You would have to assemble it yourself.
Generally people do this via an uber jar and the maven-shade plugin.
Our maven project template shows how to do this out of the box:

For distribution, just note in the newer version we will be switching the compatibility to be ubuntu 18 and above. If you need older (centos 6) we will be publishing a compat library. You can see the context behind the recent discussion for that here:

For openjdk, I would recommend java 8 or 11. Openjdk provides default images out of the box. You can see examples of that here:
https://hub.docker.com/_/openjdk

1 Like

Yes, it is. As @agibsonccc already mentioned, you need to use uber-JAR and maven-shade plugin. For building the JAR I use the command clean install -Djavacpp.platform=linux-x86_64 -f pom.xml. In order to build a JAR with a specific classifier you could also use maven profiles. As a base docker image I use openjdk:16-jdk-slim-buster. As an entry point you simply provide a standard java -jar command pointing to your uber-JAR - just as you would do this from the command line.

1 Like

@agibsonccc
Thx for your quick response.
In our project we don’t use maven shade plugin but we use spring-boot-maven-plugin
is this problem ? I’m trying to find why i have some non-heap memory leak with 1.0.0-beta7

Do i have to get a specific distribution to avoid that ?
May i give you some information to solve this problem ?

Cheers,

Arnaud

@arnaud22 yes please go ahead. I’ll DM you so nothing proprietary is public.