· Dec 15, 2018 2m read

Adding Java to a IRIS Docker image

IRIS is a powerful platform and one of the new features is the Java Business Host (DOC: Connecting Systems Using Java Business Hosts) that allow you to develop Business Services and Business Operations directly in Java (JavaDocs of the InterSystems Gateway Package).

I was testing this feature using an IRIS Docker image, but this image doesn't come with Java, the image is a bare Ubuntu image plus IRIS. So I had to build a new image adding the Java stuff. After some research I finally get this Dockerfile:

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y  software-properties-common && \
    add-apt-repository ppa:webupd8team/java -y && \
    apt-get update && \
    echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
    apt-get install -y oracle-java8-installer && \
    apt-get clean

I also build a docker compose file in order to create the container and start it in a easy way:

version: '3.6'
    build: .
    image: irisjava:v1.1.0   
    command: --log /usr/irissys/mgr/messages.log
    hostname: iris    
    container_name: iris2019.1
      - ${PWD}/shared/:/shared
      - 51773:51773
      - 52773:52773
      - 55555:55555
      - ISC_DATA_DIRECTORY=/shared/iris_conf.d

Everything works well after a 'docker-compose up -d'

Maybe this is useful for someone working with IRIS Docker images and Java Business Hosts.


Discussion (8)2
Log in or sign up to continue

A small suggestion: you may not wish to use "--log /usr/irissys/mgr/messages.log" in conjunction with ISC_DATA_DIRECTORY.  As soon as the system has finished coming up, all ongoing logging will be written to ISC_DATA_DIRECTORY/mgr/messages.log.  The docker-compose file you have here will result in the output of "docker logs iris2019.1" being relatively short, ending in "Executing iris qlist", and omitting everything after the first few seconds of startup.

For better logging to container stdout, you might wish to use something like "--log /shared/iris_conf.d/mgr/messages.log".

Hope this helps!

There are some changes coming in the near future to the default logging behavior of the IRIS container . The goal is improve the usefulness of what is written to standard out by default. Of course, if you need to customize (or want to turn it off) --log is there for you, but soon you will not need to manually specify messages.log as it will be there by default (Durable %SYS or not, whichever one is active). The current syntax you have, and what Conor suggests, will work moving forward, but with an upcoming release (under wraps) it will become unnecessary.

Ummmh... not sure about this.

Specially in the case of Java Business Host Services and Operations because the JVM must run inside the IRIS instance memory (AFAIK), in this case there is no way of interaction between two different Containers or... there is a way? when I use two or more containers the interaction always was done using TCP/IP (Understand container communication).

This is a good question to clarify.