PostGIS 2.3 on Postgres 9.6. Based on the official Postgres container and mdillon/postgis.
1.4K
This Docker image offers PostgreSQL + PostGIS database.
To build this image from Dockerfile run this command in your Docker or Docker Toolbox shell:
docker build -t hotmaps/postgis-database .
To create a container use this command*:
docker run --name postgis-database -e POSTGRES_USER=myuser -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_DB=toolboxdb –e PGDATA="/var/lib/postgresql/data" -v "/c/path/to/volume:/var/lib/postgresql/data" -p 32768:5432 -d hotmaps/postgis-database
On Windows the absolute path to your code directory should be in the format /c/My-first-dir/my-second-dir/my-code-dir
For more detailed instructions about how to start and control your Postgres container, see the documentation for the postgres image here.
docker run -it --link postgis-database:toolboxdb --rm postgres \
sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U myuser'
This image ensures that the default database created by the parent postgres image will have the following extensions installed:
postgispostgis_topologyfuzzystrmatchpostgis_tiger_geocoderUnless -e POSTGRES_DB is passed to the container at startup time, this database will be named after the admin user (either postgres or the user specified with -e POSTGRES_USER). If you would prefer to use the older template database mechanism for enabling PostGIS, the image also provides a PostGIS-enabled template database called template_postgis.
See the PostGIS documentation for more details on your options for creating and using a spatially-enabled database.
Special thanks to the work done on the repository https://github.com/appropriate/docker-postgis.
Content type
Image
Digest
Size
210.4 MB
Last updated
over 9 years ago
docker pull hotmaps/postgis-database