This is a postgres container for use with Sal, Crypt, etc. There are 3 variables that are exposed which the user may set.
docker pull grahamgilbert/postgres:9.4.5
There are 3 exposed variables, see below for a full description:
$DB_NAME - Passes a string to the container as an environmental variable and creates a database with this value as its name.
$DB_USER - Passes a string to the container as an environmental variable and creates a role with this value as its name.
$DB_PASS - Passes a string to the container as an environmental variable and sets the role created with DB_USER to have this password.
Postgres will convert the strings to lower case when it creates the database and roles. Please ensure that you are passing lower case values here or you may have issues when you link other containers.
mkdir -p /some/dir/db
docker run -d --name"sal-db" \
-v /some/dir/db:/var/lib/postgresql/data \
-e DB_NAME="somename" \
-e DB_USER="username" \
-e DB_PASS="myPassw0rd" \
--restart="always" \
grahamgilbert/postgres:9.4.5
You can check the status and logs of this and many other running containers with the following command:
docker logs <container name or ID>
Or in our case:
docker logs sal-test
Content type
Image
Digest
sha256:b69fdb828…
Size
141.3 MB
Last updated
over 3 years ago
docker pull grahamgilbert/postgres