diff options
author | Irina Truong <i.chernyavska@gmail.com> | 2017-04-19 15:04:56 -0700 |
---|---|---|
committer | Irina Truong <i.chernyavska@gmail.com> | 2017-04-19 15:04:56 -0700 |
commit | ad326f7f035e036647a2600047e8b427b1832842 (patch) | |
tree | 00773737f78ef96df84dbf4ddfef1002f9707a10 | |
parent | befb3b6e2f0360808cbd3a1d2a4f96fa74ec6c72 (diff) | |
parent | da434103cc3d61180b876bc965b4bf71f670a83b (diff) |
Merge branch 'master' into amjith/author-update
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | Dockerfile | 6 | ||||
-rw-r--r-- | README.rst | 29 |
3 files changed, 36 insertions, 0 deletions
@@ -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 @@ -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: ------- |