scripts psql 2 lines script to execute psql from host to docker container created with docker run --name POSTGRES -d -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=foobar postgres Put this in your $PATH