geo-data / openstreetmap-tiles-docker

The OpenStreetMap Tile Server in a Docker container
219 stars 148 forks source link

error trying to build osm2pgsql #18

Closed haroldship closed 8 years ago

haroldship commented 8 years ago

I'm pretty new to docker. I hand-built an OSM tile server and want to create a docker image, hopefully based on yours, but with some modifications.

I git-cloned and tried to build the image. I get many warnings, but ultimately the build fails on this error:

Step 10 : RUN cd /tmp && git clone git://github.com/openstreetmap/osm2pgsql.git ---> Running in e21dc5361327 Cloning into 'osm2pgsql'... ---> 93cdcd7b258e Removing intermediate container e21dc5361327 Step 11 : RUN cd /tmp/osm2pgsql && ./autogen.sh && ./configure && make && make install ---> Running in 4c82958004c8 /bin/sh: 1: ./autogen.sh: not found The command '/bin/sh -c cd /tmp/osm2pgsql && ./autogen.sh && ./configure && make && make install' returned a non-zero code: 127

There appears to be an image in docker images

erikj commented 8 years ago

it looks like the build process for osm2pgsql changed w/ this commit: https://github.com/openstreetmap/osm2pgsql/commit/b0ef2692ec33dc1a9cf391027aec16adf6a175fa#diff-04c6e90faac2675aa89e2176d2eec7d8

to resolve the issue, you can either update your Dockerfile to

haroldship commented 8 years ago

Thanks that worked for the build. However, when I try to import I get the following error:

Importing /data/import.osm into his 800 osm2pgsql SVN version 0.89.0-dev (64 bit id space)

Osm2pgsql failed due to ERROR: Couldn't open style file './default.style': No such file or directory ^C*\ Shutting down /usr/local/sbin/run (PID 95)...

erikj commented 8 years ago

Osm2pgsql failed due to ERROR: Couldn't open style file './default.style': No such file or directory ^C*\ Shutting down /usr/local/sbin/run (PID 95)...

That looks like it's related to openstreetmap/osm2pgsql#515: New master build needs specifying default style

You should be able to get around it by checking out a prior commit (per above) or adding the specified flag to import()'s osm2pgsql command:

--style /usr/local/share/osm2pgsql/default.style 

https://github.com/geo-data/openstreetmap-tiles-docker/blob/master/run.sh#L81

haroldship commented 8 years ago

Thank you again @erikj. However, I had to make some other changes in order to get things working (they are now). Would you like the changes?

erikj commented 8 years ago

@haroldship yeah, that would be great, thanks!

and you're welcome! :)

haroldship commented 8 years ago

sent a pull request