summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrina Truong <i.chernyavska@gmail.com>2017-04-19 15:04:56 -0700
committerIrina Truong <i.chernyavska@gmail.com>2017-04-19 15:04:56 -0700
commitad326f7f035e036647a2600047e8b427b1832842 (patch)
tree00773737f78ef96df84dbf4ddfef1002f9707a10
parentbefb3b6e2f0360808cbd3a1d2a4f96fa74ec6c72 (diff)
parentda434103cc3d61180b876bc965b4bf71f670a83b (diff)
Merge branch 'master' into amjith/author-update
-rw-r--r--AUTHORS1
-rw-r--r--Dockerfile6
-rw-r--r--README.rst29
3 files changed, 36 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
index 053148ba..3f6c560a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -59,6 +59,7 @@ Contributors:
* Owen Stephens
* Russell Davies
* AlexTes
+ * Hraban Luyat
Creator:
--------
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..8d48e7de
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,6 @@
+FROM python:2.7
+
+COPY . /app
+RUN cd /app && pip install -e .
+
+CMD pgcli
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:
-------