Skip to content
This repository was archived by the owner on Jul 6, 2021. It is now read-only.

Commit 9f80f07

Browse files
committed
Improve README part related to Docker support
1 parent 8e71ded commit 9f80f07

File tree

1 file changed

+38
-19
lines changed

1 file changed

+38
-19
lines changed

README.md

+38-19
Original file line numberDiff line numberDiff line change
@@ -249,38 +249,55 @@ docker build -t postgres-checkup .
249249
```
250250

251251
Then run a container with `postgres-checkup`.
252-
This command run the tool with access via `psql`:
252+
This command run the tool using Postgres connection only (without SSH):
253253

254254
```bash
255255
docker run --rm \
256-
--name postgres-checkup \
257-
-e PGPASSWORD="postgres" \
258-
-v `pwd`/artifacts:/artifacts \
259-
postgres-checkup \
260-
./checkup -h $PG_HOST -p 5432 --username postgres --dbname postgres --project docker -e 1
256+
--name postgres-checkup \
257+
-e PGPASSWORD="postgres" \
258+
-v `pwd`/artifacts:/artifacts \
259+
postgres-checkup \
260+
./checkup \
261+
-h hostname \
262+
-p 5432 \
263+
--username postgres \
264+
--dbname postgres \
265+
--project c \
266+
-e "$(date +'%Y%m%d')001"
261267
```
262268

263-
If you want to execute all supported checks you have to use `ssh` access to target host with postgres.
264-
With docker container it's possible by mounting the ssh key file and specify the username in `-h` parameter:
269+
In this case some checks (those requiring SSH connection) will be skipped.
270+
271+
If you want to have all supported checks, you have to use SSH access to the
272+
target machine with Postgres database.
273+
274+
If SSH connection to the Postgres server is available, it is possible to pass
275+
SSH keys to the docker container, so postgres-checkup will switch to working via
276+
remote SSH calls, generating all reports:
265277

266278
```bash
267279
docker run --rm \
268-
--name postgres-checkup \
269-
-e PGPASSWORD="postgres" \
270-
-v `pwd`/artifacts:/artifacts \
271-
-v `pwd`/ssh/key:/root/.ssh/id_rsa:ro \
272-
postgres-checkup \
273-
./checkup -h $SSH_USER@$PG_HOST -p 5432 --username postgres --dbname postgres --project docker -e 1
280+
--name postgres-checkup \
281+
-v "$(pwd)/artifacts:/artifacts" \
282+
-v "$(echo ~)/.ssh/id_rsa:/root/.ssh/id_rsa:ro" \
283+
postgres-checkup ./checkup \
284+
-h sshusername@hostname \
285+
--username my_postgres_user \
286+
--dbname my_postgres_database \
287+
--project docker_test_with_ssh \
288+
-e "$(date +'%Y%m%d')001"
274289
```
275290

276-
If you try to check the local instance of postgres on your host from a container, you can't use `localhost` in `-h` parameter.
277-
You have to use `bridge` between host OS and Docker Engine. By default host IP is `172.17.0.1` in `docker0` network, but it can be different.
278-
More information [here](https://nickjanetakis.com/blog/docker-tip-65-get-your-docker-hosts-ip-address-from-in-a-container).
291+
If you try to check the local instance of postgres on your host from a container,
292+
you cannot use `localhost` in `-h` parameter. You have to use a bridge between
293+
host OS and Docker Engine. By default, host IP is `172.17.0.1` in `docker0`
294+
network, but it vary depending on configuration. More information [here](https://nickjanetakis.com/blog/docker-tip-65-get-your-docker-hosts-ip-address-from-in-a-container).
279295

280296
### Usage with `docker-compose`
281297

282-
It will run an empty `postgres` database and `postgres-checkup` application that will stop when it's done.
283-
Local folder `artifacts` will contain `docker` subfolder with check result.
298+
It will run an empty `postgres` database and `postgres-checkup` application
299+
that will stop once it's done. The local folder named `artifacts` will contain
300+
the `docker` subfolder with checkup reports.
284301

285302
```bash
286303
docker-compose build
@@ -297,6 +314,8 @@ various developers, including but not limited to:
297314
* Alexey Lesovsky, Alexey Ermakov, Maxim Boguk, Ilya Kosmodemiansky et al. from Data Egret (aka PostgreSQL-Consulting) https://github.com/dataegret/pg-utils
298315
* Josh Berkus, Quinn Weaver et al. from PostgreSQL Experts, Inc. https://github.com/pgexperts/pgx_scripts
299316

317+
Docker support implemented by [Ivan Muratov](https://gitlab.com/binakot).
318+
300319
# The Full List of Reports
301320

302321
## А. General / Infrastructural

0 commit comments

Comments
 (0)