Skip to content

Instantly share code, notes, and snippets.

@ramses-lopez
Created September 1, 2018 17:37
Show Gist options
  • Save ramses-lopez/18fdc563b0275030515a8c3428937a07 to your computer and use it in GitHub Desktop.
Save ramses-lopez/18fdc563b0275030515a8c3428937a07 to your computer and use it in GitHub Desktop.
Docker + Postgres
// create instance
docker run -d -p 5432:5432 --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword postgres
// enter instance
docker exec -it my-postgres bash
// ... create users, dbs, w/e ...
// Install psql on local machine
sudo apt-get install postgresql-client
// Connect to postgres instance
psql -h localhost -p 5432 -U postgres -W
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment