Sign inSign up

robinthrift/raspbian-postgres

By robinthrift

Updated almost 11 years ago

Postgres compiled and packaged for the Raspberry Pi 2

Image
0

10K+

robinthrift/raspbian-postgres repository overview

See https://hub.docker.com/_/postgres/ for most info

How to use this image

start a postgres instance
$ docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres

This image includes EXPOSE 5432 (the postgres port), so standard container linking will make it automatically available to the linked containers. The default postgres user and database are created in the entrypoint with initdb.

connect to it from an application

$ docker run --name some-app --link some-postgres:postgres -d application-that-uses-postgres

Environment Variables

The PostgreSQL image uses several environment variables which are easy to miss. While none of the variables are required, they may significantly aid you in using the image.

POSTGRES_PASSWORD

This environment variable is recommended for you to use the PostgreSQL image. This environment variable sets the superuser password for PostgreSQL. The default superuser is defined by the POSTGRES_USER environment variable. In the above example, it is being set to "mysecretpassword".

POSTGRES_USER

This optional environment variable is used in conjunction with POSTGRES_PASSWORD to set a user and its password. This variable will create the specified user with superuser power and a database with the same name. If it is not specified, then the default user of postgres will be used.

PGDATA

This optional environment variable can be used to define another location - like a subdirectory - for the database files. The default is /var/lib/postgresql/data, but if the data volume you're using is a fs mountpoint (like with GCE persistent disks), Postgres initdb recommends a subdirectory (for example /var/lib/postgresql/data/pgdata ) be created to contain the data.

Tag summary

Content type

Image

Digest

sha256:17d333f62

Size

96.6 MB

Last updated

almost 11 years ago

docker pull robinthrift/raspbian-postgres