小编Ahm*_*man的帖子

从 docker-compose 文件初始化 postgres 容器

我正在尝试从 docker-compose 文件启动 postgres 容器并对其进行初始化。

docker-compose.yml

version: "3"
  postgres:
  image: "postgres"
  command: bash -c "
   postgres &&
   createuser -l \"auser\"
   "
Run Code Online (Sandbox Code Playgroud)

我的目标是:1)启动 postgres 容器 2)创建一个用户

当前实现失败并出现以下错误

"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise.  See the documentation for
more information on how to properly start the server.
Run Code Online (Sandbox Code Playgroud)

postgresql docker dockerfile docker-compose

2
推荐指数
1
解决办法
3795
查看次数

标签 统计

docker ×1

docker-compose ×1

dockerfile ×1

postgresql ×1