CentOS 6 dockerfile for PostgreSQL 8.4
To build the image
# docker build --rm -t <yourname>/postgresql .
docker run --name=postgresql84 -d -p 5432:5432 <yourname>/postgresql
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)
Content type
Image
Digest
sha256:88b805d3d…
Size
98 MB
Last updated
almost 11 years ago
docker pull ganeshravi/postgresql