summaryrefslogtreecommitdiffstats
path: root/README.rst
diff options
context:
space:
mode:
authorHraban Luyat <hraban@0brg.net>2017-03-02 22:30:40 +0000
committerHraban Luyat <hraban@0brg.net>2017-04-15 23:14:51 +0100
commit0bf665d41d7f454a54d7c37c1025d46926c04fe8 (patch)
tree1e2a7b8a16d748d916af25b9e5a7541208c89f15 /README.rst
parent7263a38cfcdeecc17831bcc4a4045dcbf026344e (diff)
README: Explain how to use with Docker
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst29
1 files changed, 29 insertions, 0 deletions
diff --git a/README.rst b/README.rst
index dc31d9ab..12dad78e 100644
--- a/README.rst
+++ b/README.rst
@@ -180,6 +180,35 @@ Then you can install pgcli:
$ sudo pip install pgcli
+Docker
+======
+
+Pgcli can be run from within Docker. This can be useful to try pgcli without
+installing it, or any dependencies, system-wide.
+
+To build the image:
+
+::
+ $ docker build -t pgcli .
+
+To create a container from the image:
+
+::
+ $ docker run --rm -ti pgcli pgcli <ARGS>
+
+To access postgresql databases listening on localhost, make sure to run the
+docker in "host net mode". E.g. to access a database called "foo" on the
+postgresql server running on localhost:5432 (the standard port):
+
+::
+ $ docker run --rm -ti --net host pgcli pgcli -h localhost foo
+
+To connect to a locally running instance over a unix socket, bind the socket to
+the docker container:
+
+::
+ $ docker run --rm -ti -v /var/run/postgres:/var/run/postgres pgcli pgcli foo
+
Thanks:
-------