Skip to content

Instantly share code, notes, and snippets.

@advincze
Created January 22, 2019 14:59
Show Gist options
  • Save advincze/3e562116da1085c9e4307353e590473a to your computer and use it in GitHub Desktop.
Save advincze/3e562116da1085c9e4307353e590473a to your computer and use it in GitHub Desktop.
docker postgres

run postgres in docker

docker run -it --rm --name pg -e POSTGRES_PASSWORD=pgp -e POSTGRES_USER=pgu -e POSTGRES_DB=pgdb -p 5432:5432 postgres

connect to postgres from psql:

PGPASSWORD=pgp psql --dbname pgdb --host=localhost --username=pgu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment