Sign inSign up

ganeshravi/postgresql

By ganeshravi

Updated almost 11 years ago

PostgreSQL 8.4 on CentOS 6

Image
1

10K+

ganeshravi/postgresql repository overview

dockerfiles-centos-postrgresql

CentOS 6 dockerfile for PostgreSQL 8.4

Setup

To build the image

# docker build --rm -t <yourname>/postgresql .

Starting PostgreSQL

docker run --name=postgresql84 -d -p 5432:5432 <yourname>/postgresql

Creating a database at launch

You can create a postgresql superuser at launch, by specifying 'POSTGRESQL_USER', 'POSTGRESQL_PASS' and 'POSTGRESQL_DB' variables. For all the above variables, a default value of 'docker' is used if not specified.

docker run --name postgresql84 -d -p 5432:5432 \
-e 'POSTGRESQL_USER=<db_username>' \
-e 'POSTGRESQL_PASS=<password>' \
-e 'POSTGRESQL_DB=<db_name>' \
<yourname>/postgresql

To connect to the database with the user created above:

psql -U <db_username> -h $(docker inspect --format {{.NetworkSettings.IPAddress}} postgresql84)

Tag summary

Content type

Image

Digest

sha256:88b805d3d

Size

98 MB

Last updated

almost 11 years ago

docker pull ganeshravi/postgresql