[英]Docker fails to build PostgreSQL 12 on Centos 8
Installing PostgreSQL 12 on Centos 8 fails with:在 Centos 8 上安装 PostgreSQL 12 失败并显示:
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.添加
glibc-langpack-en
解决了这个问题。 In the Dockerfile: RUN yum install -y glibc-langpack-en
在 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
.我尝试了其他一些关于向命令添加不同区域设置的建议,例如:
initdb -E UTF8 --locale=en_US.utf8
或RUN localedef -i en_US -f UTF-8 en_US.UTF-8
。 Those did not work for me.那些对我不起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.