HSLdevcom / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
33 stars 31 forks source link

Unable to run docker with M1 Macs #364

Open Valleyaapo opened 3 years ago

Valleyaapo commented 3 years ago

Expected behavior

Docker run should not get stuck

Observed behavior

Using M1 Mac docker run for OpenTripPlanner gets stuck and prints only JAR=otp-shaded.jar

Data sets in use

I followed the guide in the link on how to use OpenTripPlanner with docker https://digitransit.fi/en/developers/architecture/x-apis/1-routing-api/

Command line used to start OTP

docker run -e OTP_DATA_CONTAINER_URL=http://otp-data-container:8080 -p 8080:8080 hsldevcom/opentripplanner

Steps to reproduce the problem

Run the above command in Apple silicon M1 environment

optionsome commented 3 years ago

Seems like the documentation is missing a step or two for that command to work. It would require you to have a data container locally with the dns name otp-data-container.

I think the other command found in the same documentation is closer to being correct. docker run --rm --name otp-hsl -p 9080:8080 -e ROUTER_NAME=hsl -e JAVA_OPTS=-Xmx5g -e ROUTER_DATA_CONTAINER_URL=https://api.digitransit.fi/routing-data/v2/hsl hsldevcom/opentripplanner:prod should work if you just want to run the router with HSL data locally (the allocated memory seems a bit low, u can increase it if there are problems). There will be some "java.net.UnknownHostException: digitransit-proxy: Try again" type errors when u run it because it tries to access some external APIs through a proxy that u don't have running locally but it should function normally but just without some bike rental stations etc.

If u want to run OpenTripPlanner with ur own data set or with ur own code changes, it's a bit different. Here is some documentation for it https://github.com/HSLdevcom/digitransit/wiki/Guide-for-building-and-viewing-Digitransit-OTP-graphs-locally

Valleyaapo commented 2 years ago

the above command still gets stuck and just prints JAR=otp-shaded.jar

optionsome commented 2 years ago

Have you had trouble using any other docker images? I have no idea what could cause this issue within the entrypoint of this image but saw that there might be some general issues related to docker in mac https://github.com/docker/for-mac/issues/5590 . Unfortunately no one in our team has a M1 mac so fixing this is a bit difficult. You can try building the docker image yourself from this repository and if you are not able to run the image, you can try editing the run.sh file to see where it gets stuck.