erlang / docker-erlang-otp

the Official Erlang OTP image on Docker Hub

Home Page:https://hub.docker.com/_/erlang/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image version with Java support

mmacai opened this issue · comments

Hi, we are working on an Elixir application that uses jinterface to be able to communicate with Java application. The use case for that is AWS Kinesis that has client library only in Java and thus there is no other choice. This is the Java part: https://github.com/Accenture/reactive-interaction-gateway/tree/master/kinesis-client.

Is there any chance to create official docker image also with Java (jinterface) support? (and perhaps the same for Elixir image)

We would like to avoid checked in jinterface and use it natively from Erlang.

commented

for the messaging services, I've used both Kafka and Google PubSub, both have client side library in many programming language bindings, however the AWS Kinesis officially only have Java, Nodejs, .Net, Python and Ruby client, and I looked into its Python and Nodejs client, checking if possibly for someone be able easily create a pure Erlang or pure Elixir client library, but it doesn't look like so
because both the Nodejs and Python library are thin wrapper interface to the Amazon Kinesis Client Library (KCL) MultiLangDaemon which is in Java, means you would have to deploy with a JVM

https://docs.aws.amazon.com/streams/latest/dev/kinesis-record-processor-implementation-app-nodejs.html
https://docs.aws.amazon.com/streams/latest/dev/kinesis-record-processor-implementation-app-py.html

usually I would like to avoid JVM because that would bloat the image, wonder have you tried build a customized image on top of this one, could install a JVM from the example Dockerfile from openjdk image? or download and install a SunJRE in a similar approach; (or I would find some time try this approach)
https://github.com/docker-library/openjdk/blob/master/9-jre/Dockerfile

https://cwiki.apache.org/confluence/display/KAFKA/Clients

We are fine with Kafka and other stuff, this is just about AWS Kinesis. We know about daemon, we just didn't like that approach and tried jinterface to use directly Java app without daemon. We are also fine with deployment.

Only thing is that Erlang/Elixir docker images don't have jinterface thus we included one in git repo and copied to final docker image. However, this works, it's not the nicest approach as well.

Regarding custom Erlang/Elixir images, that's something we would like to avoid, because we would have to do that with every OTP or Elixir release.

Therefore I'm just curious if there is any chance to have official Erlang/Elixir image compiled with Java (maybe with some tag e.g. java).

If done, the image size will be much bigger.

If you have your Dockerfile extending to add the code you need, you can easily extend it on Dockerhub. Dockerhub automatically builds for you if you Dockerfile gets updated on a public github, it also reports on change on your dependency that breaks the image build. Usually, images like this one are expected to be very lean, as if the image grows can trigger complain form the users. Packing java into images is tricky due to different sources of JVMs and others variations of settings.