I am currently trying to set-up an instance of Open Trip Planner 2 in docker. I have created two compose files which execute the same docker image, but with different arguments.
However, currently I am having quite a lot of trouble getting the OTP JAR file to execute correctly.
I am getting the following error:
ERROR: for otp Cannot start service otp: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "otp": executable file not found in $PATH: unknown.
After a quick google search I found the following question, but after changing the docker-compose command argument, the error still occurs.
My Dockerfile:
FROM openjdk:11
LABEL maintainer="Tristan van Triest <tristantriest@gmail.com>"
ENV OTP_VERSION=2.1.0
ADD https://repo1.maven.org/maven2/org/opentripplanner/otp/$OTP_VERSION/otp-$OTP_VERSION-shaded.jar /usr/local/share/java/
RUN ln -s otp-$OTP_VERSION-shaded.jar ./otp.jar
COPY . .
EXPOSE 8080
ENTRYPOINT [ "otp" ]
My docker-compose file:
version: '3.7'
services:
otp:
build:
context: .
dockerfile: dockerfile
restart: unless-stopped
ports:
- 9494:8080
volumes:
- ./graphs:/var/otp/graphs
environment:
- JAVA_OPTIONS=-Xmx8G
command:
[
'--maxThreads 4',
'--insecure',
'--verbose',
]
The "entrypoint" OTP file:
#!/bin/sh
exec java $JAVA_OPTIONS -jar otp.jar $@
I just simply want to be able to run the OTP Jar with different arguments. Is there an easier way to do this? Or if my current way is "correct", how can I solve the error?
Thanks, Tristan