Add postgres docs for environment variables

This commit is contained in:
Joe Ferguson 2014-11-20 11:15:59 -08:00
parent 59c911d117
commit fbf180f4d6
2 changed files with 42 additions and 2 deletions

View File

@ -47,7 +47,7 @@ Oracle.
## start a postgres instance ## start a postgres instance
docker run --name some-postgres -d postgres docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
This image includes `EXPOSE 5432` (the postgres port), so standard container This image includes `EXPOSE 5432` (the postgres port), so standard container
linking will make it automatically available to the linked containers. The linking will make it automatically available to the linked containers. The
@ -65,6 +65,26 @@ default `postgres` user and database are created in the entrypoint with
docker run -it --link some-postgres:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres' docker run -it --link some-postgres:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres'
## Environment Variables
The PostgreSQL image uses several environment variables which are easy to miss.
While none of the variables are required, they may significantly aid you in
using the image.
### `POSTGRES_PASSWORD`
This environment variable is recommend for you to use the PostgreSQL image. This
environment variable sets the superuser password for PostgreSQL. The default
superuser is defined by the `POSTGRES_USER` environment variable. In the above
example, it is being set to "mysecretpassword".
### `POSTGRES_USER`
This optional environment variable is used in conjunction with
`POSTGRES_PASSWORD` to set a user and its password. This varible will create the
specified user with superuser power and a database with the same name. If it is
not specified, then the default user of `postgres` will be used.
# How to extend this image # How to extend this image
If you would like to do additional initialization in an image derived from this If you would like to do additional initialization in an image derived from this

View File

@ -32,7 +32,7 @@ Oracle.
## start a postgres instance ## start a postgres instance
docker run --name some-postgres -d postgres docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
This image includes `EXPOSE 5432` (the postgres port), so standard container This image includes `EXPOSE 5432` (the postgres port), so standard container
linking will make it automatically available to the linked containers. The linking will make it automatically available to the linked containers. The
@ -50,6 +50,26 @@ default `postgres` user and database are created in the entrypoint with
docker run -it --link some-postgres:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres' docker run -it --link some-postgres:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres'
## Environment Variables
The PostgreSQL image uses several environment variables which are easy to miss.
While none of the variables are required, they may significantly aid you in
using the image.
### `POSTGRES_PASSWORD`
This environment variable is recommend for you to use the PostgreSQL image. This
environment variable sets the superuser password for PostgreSQL. The default
superuser is defined by the `POSTGRES_USER` environment variable. In the above
example, it is being set to "mysecretpassword".
### `POSTGRES_USER`
This optional environment variable is used in conjunction with
`POSTGRES_PASSWORD` to set a user and its password. This varible will create the
specified user with superuser power and a database with the same name. If it is
not specified, then the default user of `postgres` will be used.
# How to extend this image # How to extend this image
If you would like to do additional initialization in an image derived from this If you would like to do additional initialization in an image derived from this