Public Repository

Last pushed: 2 years ago
Short Description
PostgreSQL database: Recommended for initial setup of databases for development environment
Full Description

Base image for PostgreSQL database. Postgres 9.4.1 over a Debian 7.4. The goal is to build an image that is similar to the one provided by Cloud At Cost, allowing us to test and develop with basically the same architecture of the production environment. The base script was extracted from:

Getting started

I recommend that you configure your current user to manipulate docker without sudo.
Check this out to learn how.

1- Build the new image (from the same directory of this Dockerfile):

$ docker build -t djlebersilvestre/postgres:9.4.1 .
$ docker images
REPOSITORY                  TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
djlebersilvestre/postgres   9.4.1               7c4d4f1185ec        4 seconds ago       278.5 MB

Or you can build directly from git:

$ docker build -t djlebersilvestre/postgres:9.4.1

2- Start the server:

$ docker run --name postgres -d -p djlebersilvestre/postgres:9.4.1

3- Access the server with the client already installed in the image:

$ docker run --rm -it --link postgres:postgres djlebersilvestre/postgres:9.4.1 sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres'

Or you can setup your application / client to host=, port=5432 and password=<in Dockerfile, but probably is 'testing'>

To run the image and poke around its file system

$ docker run --rm -it djlebersilvestre/postgres:9.4.1 /bin/bash

To build a new Dockerfile upon this image (use the public image \o/)

FROM djlebersilvestre/postgres:9.4.1
# customize your image

For more information check out the project on GitHub

Docker Pull Command

Comments (0)