简体   繁体   中英

Docker fails to build PostgreSQL 12 on Centos 8

Installing PostgreSQL 12 on Centos 8 fails with:

initdb: error: invalid locale settings; check LANG and LC_* environment variables
pg_ctl: directory "/postgres/pgdata" does not exist
psql: error: could not connect to server: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
pg_ctl: directory "/postgres/pgdata" does not exist
/tracks-bin/initPostgres.sh: line 12: /postgres/pgdata/postgresql.conf: No such file or directory
/tracks-bin/initPostgres.sh: line 13: /postgres/pgdata/pg_hba.conf: No such file or directory
pg_ctl: directory "/postgres/pgdata" does not exist
psql: error: could not connect to server: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
psql: error: could not connect to server: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Adding glibc-langpack-en solved the problem. In the Dockerfile: RUN yum install -y glibc-langpack-en

I tried several other suggestions concerning adding different locale setting to commands such as: initdb -E UTF8 --locale=en_US.utf8 or RUN localedef -i en_US -f UTF-8 en_US.UTF-8 . Those did not work for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM