Dockerized postgres from official library extended by lessons learned from paintedfox and sameersbn
3.4K
PostgreSQL in a box.
$ mkdir -p /tmp/store
$ docker run -d --name="postgresql" \
-p 5432:5432 \
mkodockx/docker-postgres
To connect via explicit user, pass and db have a look at the logs.
$ docker logs postgres
POSTGRES_USER=username
POSTGRES_PASS=autogenerated_pass
POSTGRES_DATA_DIR=/path/to/data
Starting PostgreSQL...
Creating the superuser: username
2014-02-07 03:30:55 UTC LOG: database system was interrupted; last known up at 2014-02-01 07:06:21 UTC
2014-02-07 03:30:55 UTC LOG: database system was not properly shut down; automatic recovery in progress
2014-02-07 03:30:55 UTC LOG: record with zero length at 0/17859E8
2014-02-07 03:30:55 UTC LOG: redo is not required
2014-02-07 03:30:55 UTC LOG: database system is ready to accept connections
2014-02-07 03:30:55 UTC LOG: autovacuum launcher started
...
$ docker run -t -i --link postgresql:db <desired_image>
$ docker run -t -i --link postgresql:db ubuntu apt-get install -y postgresql-client && psql -U "$DB_ENV_USER" -h "$DB_PORT_5432_TCP_ADDR" -p "$DB_PORT_5432_TCP_PORT"
This container is a combination of the best containers I found providing postgresql databse.
I learned from sameersbn, Painted-Fox and of course offcial postgres image.
This container has focus on simplicity and reliability.
Set the autogenerated db user name. default: meister
Set the password of the db user. default: Will be auto generated by pwgen
Define a comma seperated set of databases to create on startup accesible by USER. default: empty (no database will be created)
Define a single or a set of extensions for the created databases from DB(required). default: empty (no extensions will be installed)
This image tries to keep the latest stable postgres version. If you want to test alpha or need a previous version - alter this. default: 9.4
Look at:
Content type
Image
Digest
sha256:de7c51603…
Size
112.5 MB
Last updated
almost 11 years ago
docker pull mkodockx/docker-postgres