Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql image #2

Merged
merged 1 commit into from
Nov 13, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions postgres91/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from ubuntu:12.04

# Configure apt
run echo 'deb http://us.archive.ubuntu.com/ubuntu/ precise universe' >> /etc/apt/sources.list
run apt-get -y update

# Make data directory for configuration and database storage
run mkdir /data /data/postgresql
run mkdir /config /config/postgresql
run ln -s /data/postgresql /var/lib
run ln -s /config/postgresql /etc

# Install PostgreSQL
run LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql-9.1

run sed -i -e "s/^#listen_addresses = 'localhost'/listen_addresses = '*'/" /etc/postgresql/9.1/main/postgresql.conf
run sed -i -e "s@127.0.0.1/32@0.0.0.0/0@" /etc/postgresql/9.1/main/pg_hba.conf
run sed -i -e "s@::1/128@::/0@" /etc/postgresql/9.1/main/pg_hba.conf

env POSTGRES_DBA_PW toor
run /etc/init.d/postgresql start && echo "ALTER USER postgres WITH PASSWORD '${POSTGRES_DBA_PW}';" | su - postgres -c "psql template1"

expose 5432

cmd ["su", "-", "postgres", "-c", "/usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf"]

# vim:ts=8:noet: