PostgreSQL script fails
Tried to build the docker image, and it failed on step 35:
Step 35 : RUN /pix/scripts/postgresqlsetup.sh ---> Running in 7bdf3116c66e 2016-02-12 22:41:59 UTC [12-1] LOG: database system was shut down at 2016-02-12 21:51:47 UTC 2016-02-12 22:41:59 UTC [22-1] postgres@postgres FATAL: the database system is starting up psql: FATAL: the database system is starting up 2016-02-12 22:41:59 UTC [12-2] LOG: MultiXact member wraparound protections are now enabled 2016-02-12 22:41:59 UTC [11-1] LOG: database system is ready to accept connections 2016-02-12 22:41:59 UTC [36-1] LOG: autovacuum launcher started 2016-02-12 22:41:59 UTC [37-1] LOG: could not open temporary statistics file "/var/run/postgresql/9.3-main.pg_stat_tmp/global.tmp": No such file or directory 2016-02-12 22:41:59 UTC [38-1] postgres@pix FATAL: database "pix" does not exist psql: FATAL: database "pix" does not exist nginx: [warn] low address bits of 127.0.0.1/8 are meaningless in /pix/nginx.conf.compiled:14 nginx: [warn] low address bits of 172.17.0.0/8 are meaningless in /pix/nginx.conf.compiled:15 nginx: [alert] lua_code_cache is off; this will hurt performance in /pix/nginx.conf.compiled:34 2016/02/12 22:41:59 [notice] 56#0: using the "epoll" event method 2016/02/12 22:41:59 [notice] 56#0: ngx_openresty/1.4.3.9 2016/02/12 22:41:59 [notice] 56#0: built by gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 2016/02/12 22:41:59 [notice] 56#0: OS: Linux 4.3.3-3-ARCH 2016/02/12 22:41:59 [notice] 56#0: getrlimit(RLIMIT_NOFILE): 1048576:1048576 2016/02/12 22:41:59 [notice] 56#0: start worker processes 2016/02/12 22:41:59 [notice] 56#0: start worker process 57 2016-02-12 22:41:59 UTC [37-2] LOG: could not open temporary statistics file "/var/run/postgresql/9.3-main.pg_stat_tmp/global.tmp": No such file or directory 2016-02-12 22:41:59 UTC [37-3] LOG: could not open temporary statistics file "/var/run/postgresql/9.3-main.pg_stat_tmp/global.tmp": No such file or directory 2016-02-12 22:42:00 UTC [37-4] LOG: could not open temporary statistics file "/var/run/postgresql/9.3-main.pg_stat_tmp/global.tmp": No such file or directory 2016-02-12 22:42:00 UTC [37-5] LOG: could not open temporary statistics file "/var/run/postgresql/9.3-main.pg_stat_tmp/global.tmp": No such file or directory 2016-02-12 22:42:01 UTC [37-6] LOG: could not open temporary statistics file "/var/run/postgresql/9.3-main.pg_stat_tmp/global.tmp": No such file or directory 2016-02-12 22:42:01 UTC [37-7] LOG: could not open temporary statistics file "/var/run/postgresql/9.3-main.pg_stat_tmp/global.tmp": No such file or directory 2016-02-12 22:42:01 UTC [37-8] LOG: could not open temporary statistics file "/var/run/postgresql/9.3-main.pg_stat_tmp/global.tmp": No such file or directory 2016-02-12 22:42:01 UTC [37-9] LOG: could not open temporary statistics file "/var/run/postgresql/9.3-main.pg_stat_tmp/global.tmp": No such file or directory 2016-02-12 22:42:02 UTC [37-10] LOG: could not open temporary statistics file "/var/run/postgresql/9.3-main.pg_stat_tmp/global.tmp": No such file or directory 2016-02-12 22:42:02 UTC [37-11] LOG: could not open temporary statistics file "/var/run/postgresql/9.3-main.pg_stat_tmp/global.tmp": No such file or directory --2016-02-12 22:42:02-- http://127.0.0.1:8080/db/make Connecting to 127.0.0.1:8080... connected. HTTP request sent, awaiting response... 2016/02/12 22:42:02 [error] 57#0: *1 lua entry thread aborted: runtime error: You have to configure either postgres or mysql stack traceback: coroutine 0: [C]: in function 'require' /pix/web.lua:2: in function </pix/web.lua:1>, client: 127.0.0.1, server: , request: "GET /db/make HTTP/1.1", host: "127.0.0.1:8080" 500 Internal Server Error 2016-02-12 22:42:02 ERROR 500: Internal Server Error.
The command '/bin/sh -c /pix/scripts/postgresqlsetup.sh' returned a non-zero code: 8
I'm sorry, but I don't use docker myself anymore so I don't maintain this script. :(
Fair enough.
This fixes the issue. Borrowed from this Dockerfile
# Correct the Error: could not open temporary statistics file "/var/run/postgresql/9.3-main.pg_stat_tmp/global.tmp": No such file or directory
RUN mkdir -p /var/run/postgresql/9.3-main.pg_stat_tmp
RUN chown postgres.postgres /var/run/postgresql/9.3-main.pg_stat_tmp -R