The base postgres image from Docker with extensions for importing OpenStreetMap data
251
The base postgres image from Docker with extensions for importing OpenStreetMap data.
Build the image:
# docker build -t mapsquare/postgres-osm .
Then launch the container:
# docker run -d --name postgres-osm mapsquare/postgres-osm
Then test with postgresql-client:
# docker run -i -t --rm --link postgres-osm:pg --entrypoint /bin/bash postgres:9.3.5 -c 'psql -h $PG_PORT_5432_TCP_ADDR -p $PG_PORT_5432_TCP_PORT -U postgres postgres'
This will use Docker's container links to connect to Postgresql without having Postgresql exposed to the host or network.
By default, the database created will be called gis and be owned by user osm. These can be changed with environment variables in the RUN command:
# docker run -d --name postgres-osm -e "OSM_USER=www-data" -e "OSM_DB=osm_dataset" mapsquare/postgres-osm
These variables can be accessed from linked containers. Consider the link alias pg:
PG_ENV_OSM_USER=osm
PG_ENV_OSM_DB=gis
These can then be passed into import scripts or clients in other containers.
Additionally, you can provide a custom tablespace using the following env variables: $DB_STORAGE_NAME and $DB_STORAGE_MOUNTPOINT.
Example:
# docker run -d --name postgres-osm -e "OSM_USER=www-data" -e "OSM_DB=osm_dataset" -e "DB_STORAGE_NAME=ssd1" -e "DB_STORAGE_MOUNTPOINT=/mnt/sdb1/db" openfirmware/postgres-osm
This Dockerfile is UNFINISHED. There are still some remaining tasks before it is usable for an OpenStreetMap database.
This Dockerfile is a fork from the original openfirmware/docker-postgres-osm. This repository will be maintained until the openfirmware pull-request is accepted and merged into the project.
Content type
Image
Digest
sha256:2f2e15052…
Size
168.4 MB
Last updated
almost 11 years ago
docker pull mapsquare/postgres-osm