Sign inSign up

helmi03/docker-postgis

By helmi03

•Updated almost 11 years ago

PostGIS 2.1 in PostgreSQL 9.3

Image
24

10K+

helmi03/docker-postgis repository overview

⁠Dockerfile PostGIS

⁠Info

This Dockerfile creates a container running PostGIS 2.1 in PostgreSQL 9.3

  • expose port 5432
  • initializes a database in /var/lib/postgresql/9.3/main
  • superuser in the database: docker/docker

⁠Install

  • docker build -t postgis:2.1 . or docker build -t postgis:2.1 github.com/helmi03/docker-postgis.git
  • docker run -d postgis:2.1

⁠Usage

To connect to database, use docker inspect CONTAINER and grep IPAddress, e.g.

CONTAINER=$(sudo docker run -d -t helmi03/postgis)
CONTAINER_IP=$(sudo docker inspect -f '{{ .NetworkSettings.IPAddress }}' $CONTAINER)
psql -h $CONTAINER_IP -p 5432 -U docker -W postgres

⁠Persistance

You can mount the database directory as a volume to persist your data:

docker run -d -v $HOME/postgres_data:/var/lib/postgresql postgis:2.1

Makes sure first need to create source folder: mkdir -p ~HOME/postgres_data.

If you copy existing postgresql data, you need to set permission properly (chown/chgrp)

⁠Meta

Build with docker version 0.7.0

⁠References

Tag summary

Content type

Image

Digest

sha256:77239c509…

Size

134.7 MB

Last updated

almost 11 years ago

docker pull helmi03/docker-postgis