You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

自定义Docker容器在Amazon CodeBuild中无法启动Postgres服务器

Postgres 10 Fails to Start in Custom Docker Container on AWS CodeBuild

我目前在使用自定义Docker容器结合Amazon CodeBuild进行代码构建工作,这个容器是我基于自己编写的Dockerfile构建的,里面预装了Java 8、Gradle 4.7和Postgres 10。

本地运行这个容器的时候,Postgres服务完全正常,但放到AWS CodeBuild环境里执行构建时,Postgres服务器却启动不起来。我特意在buildspec.yml里加了命令检查Postgres的运行状态,结果显示它处于停止状态,而且CloudWatch日志里还出现了如下连接错误:

May 18, 2018 9:26:33 AM org.postgresql.Driver connect
SEVERE: Connection error:
org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

有没有大佬遇到过类似的问题?会不会是我的Dockerfile存在什么配置问题导致了这个情况?


内容的提问来源于stack exchange,提问作者Jeevan Patil

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 07:19:55