Was anybody able to run InfiniteGraph database on a docker container?
My docker files:
Dockerfile:
FROM ubuntu:latest
# install java
ENV JAVA_VERSION 11
ENV JAVA_HOME /usr/lib/jvm/java-${JAVA_VERSION}-openjdk-amd64
RUN apt-get update && apt-get install -y openjdk-${JAVA_VERSION}-jdk
RUN update-alternatives --config java && update-alternatives --config javac
RUN java -version
ENV PATH $JAVA_HOME/bin:$PATH
# install infinite graph
RUN apt-get install -y unzip
ENV IG_INSTALLER zip-linux-gcc53-*
ENV IG_HOME /opt/infinitegraph
RUN mkdir -p ${IG_HOME}
COPY ${IG_INSTALLER} ${IG_HOME}
RUN unzip -qd ${IG_HOME} ${IG_HOME}/${IG_INSTALLER}
ENV PATH ${IG_HOME}/bin:$PATH
EXPOSE 8190
# run infinite graph
CMD exec objy startlockserver -noscm & exec objy startstudioserver > /var/log/infinitegraph.log 2>&1
docker-compose.yaml:
version: "3.0"
services:
infinitegraph:
build:
context: ./infinitegraph
container_name: infinitegraph
ports:
- "4000:8190"
restart: unless-stopped
# detach: true
Problem:
InfiniteGraph database is starting successfully but then it exits and I cannot access it from localhost:4000.
docker compose logs are:
yanis@LAPTOP-QHAEST0S:/mnt/c/Users/Yanis/Desktop/project_IASD$ docker-compose up --build infinitegraph
[+] Building 1.6s (14/14) FINISHED
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 765B 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:latest 1.3s
=> [auth] library/ubuntu:pull token for registry-1.docker.io 0.0s
=> [1/8] FROM docker.io/library/ubuntu:latest@sha256:0bced47fffa3361afa981854fcabcd4577cd43cebbb808cea2b1f33a3dd7f508 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 57B 0.0s
=> CACHED [2/8] RUN apt-get update && apt-get install -y openjdk-11-jdk 0.0s
=> CACHED [3/8] RUN update-alternatives --config java && update-alternatives --config javac 0.0s
=> CACHED [4/8] RUN java -version 0.0s
=> CACHED [5/8] RUN apt-get install -y unzip 0.0s
=> CACHED [6/8] RUN mkdir -p /opt/infinitegraph 0.0s
=> CACHED [7/8] COPY zip-linux-gcc53-* /opt/infinitegraph 0.0s
=> CACHED [8/8] RUN unzip -qd /opt/infinitegraph /opt/infinitegraph/zip-linux-gcc53-* 0.0s
=> exporting to image 0.1s
=> => exporting layers 0.0s
=> => writing image sha256:2ed0f20f546270f073983e159a6925e29bf8bcacf75481257c3097bb58b2acb6 0.0s
=> => naming to docker.io/library/project_iasd-infinitegraph 0.0s
[+] Running 1/1
✔ Container infinitegraph Recreated 0.3s
Attaching to infinitegraph
infinitegraph | InfiniteGraph (TM) Start Lock Server, Version: 2022.1
infinitegraph | Copyright (c) Objectivity, Inc 2012, 2022. All rights reserved.
infinitegraph |
infinitegraph | Warning: Unable to open /usr/spool/objy/oolsrec.log
infinitegraph | Lock Server has been started.
infinitegraph | Success.
infinitegraph exited with code 0
Things I tried:
- chatgpt suggests the latter, so I tried adding exec part in Dockerfile CMD command
In Docker, containers are expected to run a foreground process, and if
the process specified in the CMD or ENTRYPOINT exits, the container
will stop.The problem might be that the “objy startstudioserver” command is
running in the foreground and keeping the container running, but the
“objy startlockserver” command might be running in the background and
immediately exiting, which causes the container to stop
- InfiniteGraph DB is working properly when running from localhost