本文主要是介绍(20210316已解决)docker-compose创建postgresql容器exited with code 1,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
-
Overview
通过docker-compose创建postgresql容器总是失败,log显示为
containerName exited with code 1
Exit Code 1: Indicates failure due to application error
-
Solution
docker-compose.yaml文件中添加environment变量:
environment:POSTGRES_USER: examplePOSTGRES_PASSWORD: example1234POSTGRES_DB: example
我猜想是,初始化时要指定用户名、密码、数据库
-
References
- Understanding Docker Container Exit Codes
- Docker-compose up exited with code 1 but successful docker-compose build
这篇关于(20210316已解决)docker-compose创建postgresql容器exited with code 1的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!