vpicavet / docker-pggis

Docker image for GIS-enabled PostgreSQL
GNU General Public License v2.0
56 stars 21 forks source link

Image build failure #4

Closed elemoine closed 9 years ago

elemoine commented 10 years ago

The image build fails for me. This is the error I get:

Step 35 : RUN    /etc/init.d/postgresql start &&    psql --command "CREATE USER pggis WITH SUPERUSER PASSWORD 'pggis';" &&    createdb -T template0 -E UTF8 -O pggis pggis
 ---> Running in ffce12721066
/bin/sh: 1: /etc/init.d/postgresql: Permission denied
2014/08/27 17:58:47 The command [/bin/sh -c /etc/init.d/postgresql start &&    psql --command "CREATE USER pggis WITH SUPERUSER PASSWORD 'pggis';" &&    createdb -T template0 -E UTF8 -O pggis pggis] returned a non-zero code: 126

So it looks like the "postgres" user is not allowed to run /etc/init.d/postgresql in my case.

I use Ubuntu 14.04 and stock docker 0.9.1. I do not run docker.io as root, my user is in the docker group (see https://docs.docker.com/installation/binaries/#giving-non-root-access).

vpicavet commented 10 years ago

Can you try and report on version 1.5 ?

miloskroulik commented 10 years ago

I have another problem on build:

Step 32 : RUN echo "host all  all    0.0.0.0/0  md5" >> /etc/postgresql/9.4/main/pg_hba.conf
 ---> Running in 8d4a98b5a6ff
/bin/sh: 1: cannot create /etc/postgresql/9.4/main/pg_hba.conf: Directory nonexistent
2014/10/12 23:05:42 The command [/bin/sh -c echo "host all  all    0.0.0.0/0  md5" >> /etc/postgresql/9.4/main/pg_hba.conf] returned a non-zero code: 2

What can I do to debug this problem?

vpicavet commented 9 years ago

Apparently the errors on running postgresql (like the "dot" problem) are linked to https://github.com/docker/docker/issues/783

It is known a AUFS bug causing permission problems. The bug has been patched, but no released yet neither incorporated in docker. It will though. Workaround for now is removing all containers and images related to this, clone the repo, build and run. Or Docker exec to the container and run this :

mkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private

If you still have problems not related to the server not running, please open new issue.