Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danihodovic/pgcli-docker
Pgcli dockerized
https://github.com/danihodovic/pgcli-docker
docker pgcli postgresql psql
Last synced: 7 days ago
JSON representation
Pgcli dockerized
- Host: GitHub
- URL: https://github.com/danihodovic/pgcli-docker
- Owner: danihodovic
- Created: 2016-09-11T20:25:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-30T17:37:46.000Z (about 8 years ago)
- Last Synced: 2024-11-07T09:51:13.049Z (about 2 months ago)
- Topics: docker, pgcli, postgresql, psql
- Homepage:
- Size: 1000 Bytes
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pgcli-docker
Thin wrapper around pgcli (https://github.com/dbcli/pgcli). The default entrypoint is `["pgcli"].`
### Usage
docker run -it --rm --network container:$postgres_container_network danihodovic/pgcli -h postgres -U postgres
You can also use the zsh/bash hack below to connect to an image that is running postgres. It only works
if there is a container running named `*postgres*`.function pgcli-docker () {
postgres_container_names=$(docker ps | awk '{print $NF}' | grep postgres)
lines=$(echo $postgres_container_names | wc -l)
if [ "$lines" -eq 0 ]; then
echo "No container with a name containing 'postgres' running"
exit 1
fi
if [ "$lines" -gt 1 ]; then
echo "More than one postgres container running: \n$postgres_container_names"
exit 1
fidocker run -it --rm --network container:$postgres_container_names danihodovic/pgcli -h postgres -U postgres
}