Public | Automated Build

Last pushed: 3 months ago
Short Description
PostGIS 2.3 on Postgres 9.6. Based on the official Postgres container and mdillon/postgis.
Full Description

HotMaps-postgis-database Docker image

This Docker image offers PostgreSQL + PostGIS database.

Software installed:

  • PostgreSQL 9.6
  • PostGIS 2.3

Build and run:

Build

To build this image from Dockerfile run this command in your Docker or Docker Toolbox shell:

docker build -t hotmaps/postgis-database .

Run

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:

  • postgis
  • postgis_topology
  • fuzzystrmatch
  • postgis_tiger_geocoder

Unless -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.

Credits

Special thanks to the work done on the repository https://github.com/appropriate/docker-postgis.

Docker Pull Command
Owner
hotmaps
Source Repository

Comments (0)