Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PostgreSQL for dotcloud-builder
from ubuntu:precise
run LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y -q postgresql-9.1 postgresql-contrib-9.1
copy postgresql.run /init
#!/bin/bash
echo 'host all all 0.0.0.0/0 md5' >> /etc/postgresql/9.1/main/pg_hba.conf
su postgres sh -c "/usr/lib/postgresql/9.1/bin/postgres --single -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf" <<< "CREATE USER root WITH SUPERUSER PASSWORD '$1';"
su postgres sh -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 -c listen_addresses=*"
@synthomat
Copy link

synthomat commented Jun 4, 2013

Hi,

I think your image in the repo does not work since it contains a postmaster.pid which was created after the installation of postgres.

The image should be created while avoiding to start postgres right after the installation. Otherwise the startup will fail, because the user "postgres" cannot remove the .pid-file.

What do you think?

@synthomat
Copy link

synthomat commented Jun 4, 2013

I made my own repo for that. Postgres seems to be working :)

https://github.com/synthomat/dockerfiles

@jpetazzo
Copy link
Author

jpetazzo commented Jun 19, 2013

Yup, your version is much better! Thanks.

@justinmayer
Copy link

justinmayer commented Jul 14, 2013

Hi @jpetazzo. My host server lost power, and now every time I try to start up my existing PostgreSQL container via:

docker start 04202289ee9e

... the status is always listed as Ghost. Killing it and starting it over again just results in the same Ghost status. How can I resuscitate this container and get PostgreSQL up and running again?

@bfirsh
Copy link

bfirsh commented Oct 9, 2013

I've built a more complete PostgreSQL image: https://github.com/orchardup/docker-postgresql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment