-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Docker Recipes
We publish ready to use lightweight Docker images based on Alpine Linux for each OSRM release:
https://hub.docker.com/r/osrm/osrm-backend/
They can be used via
wget http://download.geofabrik.de/europe/monaco-latest.osm.pbf
docker run -t -v $(pwd):/data osrm/osrm-backend:vX.Y.Z osrm-extract -p /opt/car.lua /data/monaco-latest.osm.pbf
[ $? -eq 0 ] && echo "Extract command was successful" || echo "Extract failed"
docker run -t -v $(pwd):/data osrm/osrm-backend:vX.Y.Z osrm-contract /data/monaco-latest.osrm
[ $? -eq 0 ] && echo "Contract command was successful" || echo "Contract failed"
docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend:vX.Y.Z osrm-routed /data/monaco-latest.osrm
curl 'http://localhost:5000/route/v1/driving/7.436828612,43.739228054975506;7.417058944702148,43.73284046244549?steps=true'
Replace X.Y.Z
with the latest stable OSRM image tag you want to run.
Check the published tags here.
You can now hook up a frontend, for this see:
https://github.com/Project-OSRM/osrm-frontend
These images are created via utilities here:
https://github.com/Project-OSRM/osrm-backend-docker
If you're processing big files, you may want to customize the STXXL configuration. In this case, the easiest thing to do is put the .stxxl
configuration file in the same location as your .osm.pbf
files - these get mounted in /data
inside the container, and the working directory is set to that location when the container starts - the .stxxl
file will be automatically read and used.
I think this page is obsolete. I add few commet since I tried to compile OSMR recently using Codeblocks 20.03 on Windows 10. What I found was that
Several extra libraries ave to be installed like BZip2, lua. I was using MSYS2 so I did, pacman -S mingw-w64-x86_64-bzip2 pacman -S mingw-w64-x86_64-lua pacman -S mingw-w64-x86_64-zlib
instal Intell tbb https://github.com/oneapi-src/oneTBB/releases Extract it to a folder (e.g., C:\tbb).
Ensure to add TBB Path to CMake Command and that the bin folder of MinGW or MSYS2 (e.g., C:\msys64\mingw64\bin) is added to your system PATH environment variable.
Then in osrm-backend\build run
cmake -G "CodeBlocks - MinGW Makefiles" .. -DCMAKE_BUILD_TYPE=Release -DTBB_INCLUDE_DIR="C:/tbb/include" -DTBB_LIBRARY="C:/tbb/lib/intel64/gcc4.8/libtbb.so"
cmake -G "CodeBlocks - MinGW Makefiles" .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-fno-lto -mconsole" -DCMAKE_EXE_LINKER_FLAGS="-Wl,-e,mainCRTStartup"
It may be enough to compile.
However for some compilation problems I add to do
- remove "-Werror # Treat all warnings like error" in a CMakeLists.txt file
- add in shared_memory.hcp in line 208: (void)lock_file; // This explicitly marks lock_file as used to avoid warning of unused variable
- to avoid an Link Time Optimization (LTO) error run cmake -G "CodeBlocks - MinGW Makefiles" .. -DCMAKE_BUILD_TYPE=Release -DIPO=OFF
- put OFF in option(ENABLE_LTO "Use Link Time Optimisation" OFF) and I add set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF) in Cmake
I finally gave up because of Windows console incompatibility (Winmain not found) without knowing the reason even after having, In codebleocks Project properties, Built target, type put Console application