# Create DL4J app on docker

**URL:** <https://community.konduit.ai/t/create-dl4j-app-on-docker/1463>\
**Category:** Uncategorized\
**Created:** [June 23, 2021, 10:19am UTC](https://community.konduit.ai/t/create-dl4j-app-on-docker/1463 "2021-06-23T10:19:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arnaud22](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/arnaud22/32/1405_2.png) [@arnaud22](https://community.konduit.ai/u/arnaud22)\
**Post date:** [June 23, 2021, 10:19am UTC](https://community.konduit.ai/t/create-dl4j-app-on-docker/1463/1 "2021-06-23T10:19:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [June 23, 2021, 1:27pm UTC](https://community.konduit.ai/t/create-dl4j-app-on-docker/1463/2 "2021-06-23T13:27:49Z")

</div>

@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:

> <https://github.com/eclipse/deeplearning4j-examples/blob/master/mvn-project-template/pom.xml#L109>

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:

> <https://github.com/eclipse/deeplearning4j/issues/9352>
>
> \#### Issue Description
> 
> While trying to upgrade from 1.0.0-beta7 to M1, we hit… the following issue on our CI server:
> 
> \`\`\`
> Caused by: java.lang.UnsatisfiedLinkError: /var/lib/jenkins/.javacpp/cache/nd4j-native-1.0.0-M1-linux-x86\_64.jar/org/nd4j/nativeblas/linux-x86\_64/libjnind4jcpu.so: /lib64/libstdc++.so.6: version \`CXXABI\_1.3.8' not found (required by /var/lib/jenkins/.javacpp/cache/nd4j-native-1.0.0-M1-linux-x86\_64.jar/org/nd4j/nativeblas/linux-x86\_64/libjnind4jcpu.so)
> \`\`\`
> 
> It appears as if the milestone release used a different (newer) g++ compiler version than the previous beta versions to build the some native libraries, which makes it incompatible with hosts running older Linux versions (e.g. CentOS 7).
> 
> Was this an intentional breaking change?
> 
> \#### Version Information
> 
> Please indicate relevant versions, including, if relevant:
> 
> \* Deeplearning4j version: 1.0.0-M1
> \* Platform information: CentOS 7

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](https://hub.docker.com/_/openjdk)

---

<div class="post-metadata">

**Author:** ![partarstu](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/partarstu/32/276_2.png) [@partarstu](https://community.konduit.ai/u/partarstu)\
**Post date:** [June 24, 2021, 8:27am UTC](https://community.konduit.ai/t/create-dl4j-app-on-docker/1463/3 "2021-06-24T08:27:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![arnaud22](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/arnaud22/32/1405_2.png) [@arnaud22](https://community.konduit.ai/u/arnaud22)\
**Post date:** [July 12, 2021, 10:00am UTC](https://community.konduit.ai/t/create-dl4j-app-on-docker/1463/4 "2021-07-12T10:00:11Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [July 12, 2021, 10:01am UTC](https://community.konduit.ai/t/create-dl4j-app-on-docker/1463/5 "2021-07-12T10:01:12Z")

</div>

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