首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在OS X上使用Docker构建Haskell/Postgres项目

无法在OS X上使用Docker构建Haskell/Postgres项目
EN

Stack Overflow用户
提问于 2017-07-15 05:52:02
回答 1查看 127关注 0票数 1

我正在尝试用Docker构建和运行Haskell项目。项目包含PSQL数据库。当我编写运行命令docker run project_name /usr/local/bin/project_name时,我会得到:

代码语言:javascript
复制
    $ docker run carma-bundle /usr/local/bin/carma
no port specified, defaulting to port 8000
carma:
Initializer threw an exception...
libpq: failed (could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
)

...but before it died it generated the following output:
Initializing app @ /
Initializing heist @ /heist
...loaded 0 templates from /srv/snaplets/heist
...adding 1 templates from resources/static/tpl with route prefix //
Initializing CookieSession @ /session
Initializing postgresql-simple @ /db
Initializing postgresql-auth @ /auth
...setting up filesystem

其他信息:

代码语言:javascript
复制
$ docker --version
Docker version 17.06.0-ce, build 02c1d87

$ psql --version
psql (PostgreSQL) 9.3.16

$ stack --numeric-version
1.4.0
EN

回答 1

Stack Overflow用户

发布于 2017-07-15 06:23:48

是在主机"localhost“(127.0.0.1)上运行的服务器,它接受

端口5432上的TCP/IP连接?

这告诉您,在本地主机上,在您的容器中,没有postgres在运行。

每个容器都有自己的本地主机地址。它们与其他容器中的localhost是分开的,并且与运行Docker的主系统上的localhost地址是分开的。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45112096

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档