This repo builds a docker image that accepts the same env vars as the official postgres build but with a much smaller footprint. It achieves that by basing itself off the great alpine docker image by GliderLabs.
$ docker images
REPOSITORY TAG VIRTUAL SIZE
alpine-postgres latest 22.28 MB
postgres latest 213.90 MB
$ make build
This image works in the same way the official postgres
docker image work.
It's documented on DockerHub in it's README: https://hub.docker.com/_/postgres/.
For example, you can start a basic PostgreSQL server, protected by a password, listening on port 5432 by running the following:
$ docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d alpine-postgres
Next, you can start you app's container while linking it to the PostgreSQL container you just created giving it access to it.
$ docker run --name some-app --link some-postgres:postgres -d application-that-uses-postgres
Your app will now be able to access POSTGRES_PORT_5432_TCP_ADDR
and POSTGRES_PORT_5432_TCP_PORT
environment variables.
MIT. See LICENSE
file.