Connect to postgres running inside boot2docker
If you run a postgres container using boot2docker, this one-liner will connect the psql client.
PGPASSWORD=dbpassword psql -h $(boot2docker ip) -p $(docker inspect postgres | jq -r '.[0].NetworkSettings.Ports["5432/tcp"][0].HostPort') -U dbuser dbname
This requires jq
Written by Lorin Hochstein
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Postgres
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#