Nvidia Jetson TX2 and JDK8

For various reasons, I’m trying to port a system using C, Java 8, Tomcat 8, Nvidia CUDA…onto a Nvidia Jetson TX2. I know that the best practice is to split up these applications into separate services but that requires more refactoring time.

I started with the “stock” dockerfile.template base image:

FROM resin/%%RESIN_MACHINE_NAME%%-debian

which has JDK/JRE 7 and it can run in privileged mode with systemd, cuda driver, tomcat, it all works. Except we need JDK 8.

So, I tried the more recent:

FROM balenalib/jetson-tx2-ubuntu-openjdk:8-jdk-xenial-build-20181207

and

FROM balenalib/jetson-tx2-debian-openjdk:8-jdk-stretch-build-20181207

But neither of those can run systemd, even if I apt-get install -y systemd and have ENV INITSYSTEM on

I’ve created the repository https://github.com/EIODiagnostics/balena-jetson-tx2-experiments to test this issue. I’ve added a docker-compose.yml file to make sure that my container is privileged. (because our account allows us to create multicontainer applications)

Application: https://dashboard.balena-cloud.com/devices/b48ae63a1a7ae08181188230bad6ec2d/summary

Suggestions on how to get systemd running?

Hi @jason10,

We have some examples on setting up systemd in the new base images here: https://github.com/balena-io-library/base-images/tree/master/examples/INITSYSTEM/systemd/systemd - I think you can adapt that to start from the debian-openjdk image instead. There’s a few tricks in that entry.sh file that we used to do in the old base images to get systemd working.

Hope this helps!

Thanks. Though it looks like that is for the base balenaOS, not the “user” containers.

Hi @jason10. The link you received from Pablo is pointing you to an example of setting systemd in base images. You can do something similar in your images as well which will be used as a user container at runtime.

Ah, thanks, there is slightly more information here:
https://www.balena.io/docs/reference/base-images/base-images/#working-with-dynamically-plugged-devices