Ors-app automatically exited when starting

Hi,

I encountered a problem when starting openrouteservice via docker for windows.

I used the command “docker-compose up -d”. A warning arose after all 22 steps succeed:

Step 22/22 : ENTRYPOINT [“/bin/bash”, “/docker-entrypoint.sh”]
—> Running in 7927973e94c8
Removing intermediate container 7927973e94c8
—> cae039c5bd75
Successfully built cae039c5bd75
Successfully tagged docker_ors-app:latest
WARNING: Image for service ors-app was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build.

Then I executed the command: docker-compose up --build

Successfully built cae039c5bd75
Successfully tagged docker_ors-app:latest
Starting ors-app … done Attaching to ors-app
ors-app | /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
ors-app | /docker-entrypoint.sh: line 2: $‘\r’: command not found
ors-app | /docker-entrypoint.sh: line 4: $‘\r’: command not found
ors-app | /docker-entrypoint.sh: line 23: syntax error: unexpected end of file
ors-app exited with code 2

It seems that ors-app has been started, while there’s a problem caused ors-app to exit automatically. Once I check the status of ors-app using command as “docker ps -a”, it shows that ors-app exited immediately after being created.

The logs say that docker-entrypoint.sh has a syntax error: unexpected end of file. But I cannot find a syntax error. Do you think the problem is caused by docker-entrypoint.sh?

  • docker-entrypoint.sh:

#!/usr/bin/env bash

graphs=/ors-core/data/graphs

if [ -z “${CATALINA_OPTS}” ]; then
export CATALINA_OPTS=“-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.rmi.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost”
fi

if [ -z “${JAVA_OPTS}” ]; then
export JAVA_OPTS=“-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g”
fi

echo “CATALINA_OPTS="$CATALINA_OPTS"” > /usr/local/tomcat/bin/setenv.sh
echo “JAVA_OPTS="$JAVA_OPTS"” >> /usr/local/tomcat/bin/setenv.sh

if [ “${BUILD_GRAPHS}” = “True” ]; then
if [ -d “$graphs” ]; then rm -Rf “$graphs”; fi
fi

/usr/local/tomcat/bin/catalina.sh run
#Keep docker running easy
exec “$@”

(there’s a space between # and keep, since the format # balahbalah can be identified as bold font, I delete the space there.)*
Thanks a lot.

Fixed after transforming the format of line endings to Unix. Thank you.