diff --git a/0.96.0/Dockerfile b/0.96.0/Dockerfile index 58c1a4c..b96132f 100644 --- a/0.96.0/Dockerfile +++ b/0.96.0/Dockerfile @@ -32,8 +32,7 @@ ENV OSM2PGSQL_VERSION=0.96.0 \ RUN cd /tmp && git clone --depth 1 --branch $OSM2PGSQL_VERSION https://github.com/openstreetmap/osm2pgsql.git && \ mkdir -p osm2pgsql/build && \ cd osm2pgsql/build && \ - cmake .. && make install \ - rm -rf /tmp/osm2pgsql + cmake .. && make install # osmctools && clean up RUN apt-get install -y osmctools=${OSMCTOOLS_VERSION} postgresql-client-10 \ diff --git a/1.3.0/Dockerfile b/1.3.0/Dockerfile new file mode 100644 index 0000000..49161de --- /dev/null +++ b/1.3.0/Dockerfile @@ -0,0 +1,45 @@ +FROM ubuntu:bionic +MAINTAINER typebrook "typebrook@gmail.com" + +ENV DEBIAN_FRONTEND=noninteractive +RUN sed -e s%http://archive.ubuntu.com/ubuntu/%mirror://mirrors.ubuntu.com/mirrors.txt% -i /etc/apt/sources.list +RUN apt-get update \ + && apt-get dist-upgrade -y \ + && apt-get install -y vim + +RUN apt-get install -y \ + make \ + cmake \ + g++ \ + git-core \ + libboost-dev \ + libboost-system-dev \ + libboost-filesystem-dev \ + libexpat1-dev \ + zlib1g-dev \ + libbz2-dev \ + libpq-dev \ + libgeos-dev \ + libgeos++-dev \ + libproj-dev \ + lua5.2 \ + liblua5.2-dev + +ENV OSM2PGSQL_VERSION=1.3.0 \ + OSMCTOOLS_VERSION=0.8-1 + +# osm2pgsql +RUN cd /tmp && git clone --depth 1 --branch $OSM2PGSQL_VERSION https://github.com/openstreetmap/osm2pgsql.git && \ + mkdir -p osm2pgsql/build && \ + cd osm2pgsql/build && \ + cmake .. && make install + +# osmctools && clean up +RUN apt-get install -y osmctools=${OSMCTOOLS_VERSION} postgresql-client-10 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# osm replication script +ADD ./osm-importer.sh /usr/local/bin/osm-importer.sh +WORKDIR /osm +CMD ["/bin/bash", "-i", "/usr/local/bin/osm-importer.sh"] diff --git a/1.3.0/osm-importer.sh b/1.3.0/osm-importer.sh new file mode 100644 index 0000000..f04e87b --- /dev/null +++ b/1.3.0/osm-importer.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# Rex Tsai + +echo REGION=${REGION:="asia/taiwan"} +echo COUNTRY=${COUNTRY:=$(basename $REGION)} +echo DATADIR=${DATADIR:="/osm"} +echo PBF=${PBF:=$DATADIR/${COUNTRY}-latest.osm.pbf} +echo LOOP=${LOOP:=600} +HOST=download.geofabrik.de + +[ -d $DATADIR ] || (echo "$DATADIR not found" && exit -1) + +if [ -z $PG_ENV_POSTGRES_PASSWORD ] \ + || [ -z $PG_ENV_POSTGRES_DB ] \ + || [ -z $PG_ENV_POSTGRES_USER ] \ + || [ -z $PG_PORT_5432_TCP_ADDR ] \ + || [ -z $PG_PORT_5432_TCP_PORT ] ; then + echo "missing Progress settings" + +cat <