readme: added instructions to login as postgres user using the --volumes-from docker option

This commit is contained in:
Sameer Naik
2014-09-29 14:00:03 +05:30
parent 370e1aea63
commit 6a4fe7ca5b
+8 -1
View File
@@ -68,7 +68,14 @@ Run the postgresql image
docker run --name postgresql -d sameersbn/postgresql:latest
```
By default remote logins are permitted to the postgresql server and a random password is assigned for the postgres user. The password set for the `postgres` user can be retrieved from the container logs.
The simplest way to login to the postgresql container as the administrative `postgres` is to use the `--volumes-from` docker option to connect to the postgresql server over the unix socket.
```bash
docker run -it --rm --volumes-from=postgresql \
sameersbn/postgresql sudo -u postgres -H psql
```
Alternately you can fetch the password set for the `postgres` user from the container logs.
```bash
docker logs postgresql