Public Repository

Last pushed: 2 years ago
Short Description
Create a container with Postgres and a generic database
Full Description


This image is based on postgres:9.2. It creates a container with an empty database and a user with passowrd all of the same name. Initially this name is 'generic'.

You can easily change the name of the db and user by setting the env variable DB_NAME.



Create a container with postgresdatabase named sonar
docker run -d --name psql_sonar -e DB_NAME=sonar -p 12345:5432 michaelf/postgres

Link the sonar container to the forementioned container:
docker run -d --link psql_sonar:db --name sonarqube -p 9000:9000 -e SONARQUBE_JDBC_URL=jdbc:postgresql://db/sonar sonarqube

Hint the link alias db is also in the /etc/hosts file so the URL with hostname db is always correct.

Docker Pull Command