initdb: error: The program “postgres“ is needed by initdb but was not found in the same directory
【代码】initdb: error: The program "postgres" is needed by initdb but was not found in the same directory。
·
PG启动报错
[root@localhost data]# docker logs postgres
popen failure: Cannot allocate memory
initdb: error: The program “postgres” is needed by initdb but was not found in the
same directory as “/usr/lib/postgresql/12/bin/initdb”.
Check your installation.
但是换个镜像就没问题,应该是镜像跟系统不匹配吧,建议换镜像吧
docker pull postgres:bullseye
拉取镜像
docker pull postgres:12.17-bullseye
启动镜像
docker run --name postgres1217 -e POSTGRES_PASSWORD=PGdata@456 -p 5432:5432 -v /data/postgres/postgresql/data:/var/lib/postgresql/data -d postgres:12.17-bullseye
查看容器状态
docker ps -a
开放端口
firewall-cmd --add-port=5432/tcp
firewall-cmd --add-port=5432/tcp --permanent
链接测试
更多推荐
所有评论(0)