osrm-backend: Error while using Docker-Container: Error while loading shared libraries

Hello there,

I’ve got the following (extract) of a Docker-compose file:

  osrm-server:
    image: osrm/osrm-backend
    build:
      context: .
      dockerfile: ./osrm/Dockerfile.osrm
    ports:
      - 5000:5000
    command: bash -c "osrm-routed --algorithm mld berlin-latest.osrm"

The Dockerfile.osrm looks like this:

FROM osrm/osrm-backend
RUN apt-get update
RUN apt-get install -y wget
RUN wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
RUN osrm-extract -p /opt/car.lua berlin-latest.osm.pbf
RUN osrm-partition berlin-latest.osrm
RUN osrm-customize berlin-latest.osrm
EXPOSE 5000

But now the osrm-extract command is throwing an error:

osrm-extract: error while loading shared libraries: libboost_program_options.so.1.67.0: cannot open shared object file: No such file or directory
ERROR: Service 'osrm-server' failed to build: The command '/bin/sh -c osrm-extract -p /opt/car.lua berlin-latest.osm.pbf' returned a non-zero code: 127

We tested the same Dockerfile + Docker-compose on another machine and it works there, does anybody now how to fix it?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 19 (5 by maintainers)

Most upvoted comments

Using tag v5.20.0 fixes the problem and i would guess that switching the image to debian (f978900ab) causes the issue. I’m a bit confused that latest is not the latest relase but seems to be the current master. Would it not make sense to point latest to the lastest release and use a tag develop/beta/master or something similar for current developments.

Will be fixed in 5.21 by #5311, thanks @xydinesh

I tried with following docker-compose too. I can’t reproduce this issue

version: '3'
services:
  osrm-server:
    image: xydinesh/osrm5294:compose
    build:
      context: .
      dockerfile: Dockerfile.osrm
    ports:
      - 5000:5000
    command: bash -c "osrm-routed --algorithm mld berlin-latest.osrm"
docker-compose up --force-recreate
Successfully tagged xydinesh/osrm5294:compose
WARNING: Image for service osrm-server was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating tmp_osrm-server_1 ... done
Attaching to tmp_osrm-server_1
osrm-server_1  | [info] starting up engines, v5.20.0
osrm-server_1  | [info] Threads: 4
osrm-server_1  | [info] IP address: 0.0.0.0
osrm-server_1  | [info] IP port: 5000
osrm-server_1  | [info] http 1.1 compression handled by zlib version 1.2.11
osrm-server_1  | [info] Listening on: 0.0.0.0:5000
osrm-server_1  | [info] running and waiting for requests

I also have the issue on a fresh install of my machine (docker was installed 5 min ago)

docker run -t -v $(pwd):/host osrm/osrm-backend osrm-extract -p /host/new.lua /host/data/belgium-latest.osm.pbf
osrm-extract: error while loading shared libraries: libboost_program_options.so.1.67.0: cannot open shared object file: No such file or directory

Here is the result of docker image ls

REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
docker.io/osrm/osrm-backend   latest              447cbd68b3b6        45 hours ago        152 MB

Edit: i pinned the version to v5.20.0 and it works. Seems that latest is the only version causing a problem.

I tried with the current version(3d781e6f28242623e45ff3c8da27a0122012e52d) and got the same error(lib not found). With v5.20.0@sha256:23c75d40c83b287476e0ea0883dfe7c06c3d54302d41df343c36079b8a06f36e worked fine.

tip: I tried to create a symlink from libboost_program_options.so.1.67.0 to libboost_program_options.so.1.68.0 but didn’t work too.

Could you try osrm/osrm-backend:v5.20.0 as the image in the docker-compose for the osrm-server? That’s the primary difference I can spot on the first look.

it was a mistake.

RUN osrm-partition france-latest.osm
RUN osrm-customize france-latest.osm

instead of

RUN osrm-partition france-latest.osrm
RUN osrm-customize france-latest.osrm

and

command: sh -c "osrm-routed --algorithm mld france-latest.osm" instead of command: sh -c "osrm-routed --algorithm mld france-latest-osrm"

Thanks.