Sign inSign up

jnovent/postgres-client

By jnovent

Updated 6 months ago

Basic postgreSQL Client to be able to use psql, pg_dump, and other client command line

Image
Developer tools
Databases & storage
3

8.9K

jnovent/postgres-client repository overview

Intro

Basic postgreSQL Client, to be able to use all the client command line.
Running on latest Alpine.
Curl is added to the image to be able to download backup files locally to restore it into your DB.

FROM alpine
RUN apk update --no-cache && apk upgrade --no-cache && \
    apk --no-cache add postgresql-client curl
CMD [ "" ]

Usage

psql

docker run -it --rm jnovent/postgres-client:latest psql -p <PORT> -h <DNS_OR_IP> -U <USER> <DB_NAME>

pg_dump

docker run -it --rm jnovent/postgres-client:latest pg_dump -p <PORT> -h <DNS_OR_IP> -U <USER> <DB_NAME> > dump.sql

Passing password (not secured)

Passing password like this is clearly not a good idea from a security point of view.
But when you automatize things and make sure the password won't be displayed in CI / CD logs, this is very helpful.

docker run -e PGPASSWORD="<PASSWORD>" -it --rm jnovent/postgres-client:latest ...

Other possibilities

Please check the official documentation to know which command you can use with the postreSQL client

https://docs.postgresql.fr/16/reference-client.html

Tag summary

Content type

Image

Digest

sha256:2ec6e080d

Size

8.3 MB

Last updated

6 months ago

docker pull jnovent/postgres-client