Git Product home page Git Product logo

docker-postgresql's People

Contributors

adrianlzt avatar jonmorehouse avatar mauvm avatar mitulamin avatar painted-fox avatar pengux avatar ravster avatar ykhalyavin avatar zheli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-postgresql's Issues

PostgreSQL unable to start because of missing SSL certificate

Using latest image :
paintedfox/postgresql latest 283e9a149f8f 2 days ago 519.5 MB

PostgreSQL is unable to start because of missing SSL certificate file :

POSTGRES_USER=docker
POSTGRES_PASS=docker
POSTGRES_DATA_DIR=/data
Starting PostgreSQL...
Creating the superuser: docker
psql: could not connect to server: Connection refused
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Unable to create the superuser.
Retrying in 3 seconds...
2014-05-11 20:02:41 UTC FATAL:  could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied

If dbserver too slow to start, post_start_action() fails

Hi, I want to report a problem that happens on my system but not on a constant base.

Sometimes the scripts are not creating correctly the user.

I have tracked down the reason of the problem to this script

wait_for_postgres_and_run_post_start_action() {
  # Wait for postgres to finish starting up first.
  while [[ ! -e /run/postgresql/9.3-main.pid ]] ; do
inotifywait -q -e create /run/postgresql/ >> /dev/null
  done

post_start_action
}

Apparently the presence of /run/postgresql/9.3-main.pid is not enough to identify Postgres as ready to accept connections.

I have random error and logs shows that post_start_action before all the startup log entries are displayed.

I have also notice that the logic in this fork
https://github.com/waterlink/docker-postgresql/blob/master/scripts/first_run.sh
helps to avoid the problem.

Could you consider to change the "wait" logic?

PostgreSQL not correctly configured

Hi!
When I boot up the postgresql container, the super user, password and DB are not set up. The script seems to terminate right where the super user is created, therefore firstrun wont be removed as well.

I tried some things inside the container and it looks like the commands to psql are performed before the postgres server is even running. When I check the PID of postgres (using pidof postgres) right after the post_start_action() is called and before the first psql command is executed, no PID is available.
Is there a solution to wait until the postgres server is started correctly?

Best Regards,
Tobias

USER input variable ignored

When I try to run the following:
docker run --name="foo" -e PASS="bar" foo

the default PASS is overridden with "bar" instead.

When I run the following:
docker run --name="foo" -e USER="bar" foo

the USER variable is still "super".

This is using ff19c5c53b9a.

Please let me know what other info would be helpful in reproducing!

Root / postgres default password

Maybe is a silly question, but, which is the default superuser password?

All that I see is 'tricks' to reset the password. I have to open the image with /bin/bash and set it?

Thanks!

password authentication failed for user "super"

Hi

Ive tried setting up docker-postgresql several times, but always run into the same problem:

psql: FATAL: password authentication failed for user "super"
FATAL: password authentication failed for user "super"

I am using the generated password, and retrieve it via 'docker logs postgresql'.
I have also tried setting the password when running the container.

I have also tried

RUN echo "host    all    all    0.0.0.0/0    trust" >> /etc/postgresql/9.3/main/pg_hba.conf

and

RUN echo "host    all    all    0.0.0.0/0    ident" >> /etc/postgresql/9.3/main/pg_hba.conf

Neither worked.

Can you help?

Thanks

Startup is broken

On boot startup.sh is spawned multiple times and it keeps hanging in a loop, here is an output of docker top:

UID                 PID                 PPID                C                   STIME               TTY                 TIME                CMD
root                12099               1005                0                   12:45               ?                   00:00:00            /usr/bin/python3 -u /sbin/my_init
root                12125               12099               0                   12:45               ?                   00:00:00            /usr/bin/runsvdir -P /etc/service log: ash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) bash: psql: command not found bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) bash: psql: command not found bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) bash: psql: command not found bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) bash: psql: command not found
root                12126               12125               0                   12:45               ?                   00:00:00            runsv postgresql
root                12127               12125               0                   12:45               ?                   00:00:00            runsv syslog-ng
root                12128               12125               0                   12:45               ?                   00:00:00            runsv cron
root                12130               12128               0                   12:45               ?                   00:00:00            /usr/sbin/cron -f
root                12131               12127               1                   12:45               ?                   00:00:02            syslog-ng -F -p /var/run/syslog-ng.pid --no-caps
root                12138               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12152               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12166               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12184               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12202               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12220               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12242               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12270               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12292               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12318               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12345               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12371               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12401               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12431               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12461               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12495               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12529               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12563               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12606               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12644               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12682               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12724               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12766               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12814               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12860               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12906               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                12952               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                13002               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                13052               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                13102               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                13156               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                13217               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                13271               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                13329               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                13393               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run
root                13451               12099               0                   12:45               ?                   00:00:00            /bin/bash ./run

Logs are full of 'Unable to create the superuser. Retrying in 3 seconds...' messages.

USER envvar no longer respected

Using the latest image (bbpsrhag7rw7a4b6nrcy5hg on Ubuntu 14.04.1/Docker 1.2.0), providing the USER environment variable seems to have no effect, and it will default to 'super'.

$ docker run -d -p 127.0.0.1:5432:5432 \
 -e USER="mydbuser" -e DB="mydb" -e PASS="mypass" \
 paintedfox/postgresql

b46c52755....
$ docker logs b46
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 16
POSTGRES_USER=super
POSTGRES_PASS=mypass
POSTGRES_DATA_DIR=/data
POSTGRES_DB=mydb
Initializing PostgreSQL at /data
Starting PostgreSQL...
Creating the superuser: super
2014-09-17 04:16:38 UTC LOG:  database system was shut down at 2014-09-17 02:30:14 UTC
2014-09-17 04:16:38 UTC LOG:  database system is ready to accept connections
2014-09-17 04:16:38 UTC LOG:  autovacuum launcher started
NOTICE:  role "super" does not exist, skipping
Creating database: mydb

Ability to run as master/slave

Ability to run container as a master, slave, or public-slave (public reads only).

Docker run -e SERVER_TYPE="PUBLIC_SLAVE" ... paintedfox/postgresql
Docker run -e SERVER_TYPE="MASTER" ... paintedfox/postgresql
Docker run -e SERVER_TYPE="PUBLIC" ... paintedfox/postgresql

Planning to build this out over the weekend, but wanted thoughts first

Allow configuration folder to be mounted from host

Currently there is no way to change postgresql configuration without rebuilding the image. A suggestion is to mount a folder from host to be used as configuration folder for postgresql in the container.

Wrong locale?

It seems like new cluster created with default locale instead of UTF-8:

Creating cluster with UTF-8 encoding.
Creating new cluster 9.3/main ...
  config /etc/postgresql/9.3/main
  data   /var/lib/postgresql/9.3/main
  locale C
  port   5432

Logs running in a loop?

I'm having an issue with this image. When I run it it just looks like it's looping round and round, I can't connect to it the postgres instance.

I tried first straight from image in index and then by building manually. Initially I was on docker 0.8, but i've upgraded to 1.0.1 just in case. Same issue.

To reproduce:

mkdir -p /tmp/postgresql
sudo docker run -d --name="postgresql" \
             -p 127.0.0.1:5432:5432 \
             -v /tmp/postgresql:/data \
             -e USER="super" \
             -e DB="database_name" \
             -e PASS="$(pwgen -s -1 16)" \
             paintedfox/postgresql

sudo docker logs <containerId>

The logs show this repeating in a loop for ever.

*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 9
POSTGRES_USER=super
POSTGRES_PASS=E6YPMC9bumy1gJAh
POSTGRES_DATA_DIR=/data
POSTGRES_DB=database_name
Initializing PostgreSQL at /data
Starting PostgreSQL...
POSTGRES_USER=super
POSTGRES_PASS=E6YPMC9bumy1gJAh
POSTGRES_DATA_DIR=/data
POSTGRES_DB=database_name
Starting PostgreSQL...
POSTGRES_USER=super
POSTGRES_PASS=E6YPMC9bumy1gJAh
POSTGRES_DATA_DIR=/data
POSTGRES_DB=database_name

Quite possible i've made a silly error? How can I get more useful logs? What's going on!

I really like this postgres image, by far the best out there ๐Ÿ˜ƒ . It would be amazing if I could use it in my project.

Starting the container errors on old lock file.

When I start the container (with Vagrant) it exists wit an error code (Exited (1)). This is what the log looks like:

POSTGRES_USER=postgres
POSTGRES_PASS=somepassword
POSTGRES_DATA_DIR=/data
POSTGRES_DATABASE=UNWDMI
Initializing PostgreSQL at /data
Starting PostgreSQL...
Creating the superuser: postgres
2014-05-08 10:12:25 UTC FATAL:  could not remove old lock file "/var/run/postgresql/.s.PGSQL.5432.lock": Operation not permitted
2014-05-08 10:12:25 UTC HINT:  The file seems accidentally left over, but it could not be removed. Please remove the file by hand and try again.

Any idea what might cause this/how to fix this?

Connection refused

If I try to run a container using the latest image, I'm unable to connect. The connection is always refused. Any ideas? I'm doing something like this:

$ docker run -d -p 5432:5432 --name postgres -e DB=test -e USER=super -e PASS=secret paintedfox/postgresql

$ psql -h localhost -U super

PostgreSQL fails to start: [Errno 13] Permission denied setuser

Not sure if anyone else has this issue but, using the latest image, postgresql fails to start. Any help will be appreciated.

Note item two of the docker top output._

/usr/bin/runsvdir -P /etc/service log: : [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied

docker run

$ docker run -d --name="postgresql" -p 127.0.0.1:5432:5432 -v /tmp/postgresql:/data -e USER="super" -e DB="database_name" -e PASS="$(pwgen -s -1 16)" paintedfox/postgresql

docker logs

$ docker logs postgresql

*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 9
POSTGRES_USER=super
POSTGRES_PASS=nlMU71xfRsejnrbn
POSTGRES_DATA_DIR=/data
POSTGRES_DB=database_name
Starting PostgreSQL...
POSTGRES_USER=super
POSTGRES_PASS=nlMU71xfRsejnrbn
POSTGRES_DATA_DIR=/data
POSTGRES_DB=database_name
Starting PostgreSQL...
POSTGRES_USER=super
POSTGRES_PASS=nlMU71xfRsejnrbn
POSTGRES_DATA_DIR=/data
POSTGRES_DB=database_name
Starting PostgreSQL...
POSTGRES_USER=super
POSTGRES_PASS=nlMU71xfRsejnrbn
POSTGRES_DATA_DIR=/data
POSTGRES_DB=database_name
Starting PostgreSQL...

docker top

$ docker top postgresql

root                20549               19271               2                   15:46               ?                   00:00:00            /usr/bin/python3 -u /sbin/my_init
root                20578               20549               0                   15:46               ?                   00:00:00            /usr/bin/runsvdir -P /etc/service log: : [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied
root                20579               20578               0                   15:46               ?                   00:00:00            runsv postgresql
root                20580               20578               0                   15:46               ?                   00:00:00            runsv syslog-ng
root                20581               20578               0                   15:46               ?                   00:00:00            runsv cron
root                20584               20581               0                   15:46               ?                   00:00:00            /usr/sbin/cron -f
root                20591               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20593               20591               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20594               20580               0                   15:46               ?                   00:00:00            syslog-ng -F -p /var/run/syslog-ng.pid --no-caps
root                20600               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20602               20600               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20607               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20608               20607               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20614               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20616               20614               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20621               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20622               20621               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20628               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20630               20628               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20641               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20642               20641               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20648               20549               0                   15:47               ?                   00:00:00            /bin/bash ./run
root                20649               20648               0                   15:47               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20655               20549               0                   15:47               ?                   00:00:00            /bin/bash ./run
root                20656               20655               0                   15:47               ?                   00:00:00            inotifywait -q -e create /run/postgresql/

Data Directory Permission Error

POSTGRES_USER=super
POSTGRES_PASS=HelloWorld
POSTGRES_DATA_DIR=/data
POSTGRES_DB=jagtran
Starting PostgreSQL...
2014-09-22 19:34:14 UTC FATAL: data directory "/data" has wrong ownership
2014-09-22 19:34:14 UTC HINT: The server must be started by the user that owns the data directory.

Permission denied on SSL certificat

Fresh install, docker pull paintedfox/postgresql and

 docker run -d --name="postgresql" \
             -p 127.0.0.1:5432:5432 \
             -v /tmp/postgresql:/data \
             -e USER="super" \
             -e DB="database_name" \
             -e PASS="$(pwgen -s -1 16)" \
             paintedfox/postgresql

Here is the log :

POSTGRES_USER=super
POSTGRES_PASS=xxx
POSTGRES_DATA_DIR=/data
POSTGRES_DB=database_name
Starting PostgreSQL...
Couldn't initialize inotify. Are you running Linux 2.6.13 or later, and was the
CONFIG_INOTIFY option enabled when your kernel was compiled? If so,
something mysterious has gone wrong. Please e-mail [email protected]
and mention that you saw this message.
2014-09-09 13:07:23 UTC FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.