Public | Automated Build

Last pushed: a year ago
Short Description
CentOS 6 postgres 9.0
Full Description


centos postgres dockerfile modified to use postgres from the PGDG yum repos

CentOS 6 dockerfile for PostgreSQL 9.0

  1. To build

Copy the sources down and do the build-

# docker build -rm -t username/postgresql90:centos6 . |& tee postgres_build.log
  1. To run

If port 5432 is open on your host:

# docker run -d -p 5432:5432 username/postgresql90:centos6

or to assign a random port that maps to port 5432 on the container:

# docker run -d -p 5432 username/postgresql90:centos6

To see the random port that the container is listening on:

# docker ps
  1. To test

To find the IP address, get the container ID:

# docker ps

Then get the IP addr:

# docker inspect 7a1e1a80e948 | grep -i ipaddress

Now connect to the database. In this case, it's called 'dockerdb' and the
username is 'dockeruser' with a password of 'password', which was set via the script.

# psql -h 172.17.0.x -U dockeruser -d dockerdb
Docker Pull Command

Comments (0)