From 6a4fe7ca5bec7cd21c1b34cdf3ebbb39eda18315 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Mon, 29 Sep 2014 14:00:03 +0530 Subject: [PATCH] readme: added instructions to login as postgres user using the `--volumes-from` docker option --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 22d1237..0f5ca52 100644 --- a/README.md +++ b/README.md @@ -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