gpt4 book ai didi

postgresql - 官方 Postgres 图像如何使用环境变量创建用户和数据库?

转载 作者:行者123 更新时间:2023-11-29 13:00:40 25 4
gpt4 key购买 nike

Docker 的官方 Postgres 镜像使用两个环境变量:POSTGRES_USER 和 POSTGRES_PASSWORD 参数化数据库创建:

https://registry.hub.docker.com/_/postgres/

我预计环境变量将在图像源中使用:

https://github.com/docker-library/postgres/blob/bfca9b8a92a99ccfc8f04933b7ecc29a108c7f49/9.4/Dockerfile

但那里没有他们的踪迹。

您能解释一下如何使用容器创建使用环境变量指定的用户吗?

最佳答案

变量POSTGRES_USERPOSTGRES_PASSWORD 用于entrypoint.sh文件 visible here .

关于postgresql - 官方 Postgres 图像如何使用环境变量创建用户和数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31075797/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com