based on library/postgres:9.4
with added support for initial database creation
docker run -d --name psql_sonar -e DB_NAME=<database_name> -p 5432:5432 agileit/postgres
This statement creates a database named <database_name> with a user and password with the same name. E.g.
docker run -d --name psql_sonar -e DB_NAME=mydb -p 5432:5432 agileit/postgres
creates a database mydb
with an owner mydb
which has the password mydb
.