2014-09-29 73 views
0

我成功地将一个couchdb墨盒部署到了wso2stratos,并且成员激活成功。对于我使用this git代码的dockerfile的实现。其中包括下面的行,我不知道为什么它在那里!有人可以解释下面的代码吗?Couchdb墨盒在Docker镜像中没有响应

RUN printf "[httpd]\nport = 8101\nbind_address = 0.0.0.0" > /usr/local/etc/couchdb/local.d/docker.ini 
EXPOSE 8101 
CMD ["/usr/local/bin/couchdb"] 

我试过指向http://127.0.0.1:5984/_utils/spec/run.html url,它的工作完美。

我只是SSH的泊坞窗容器并启动CouchDB的,

[email protected]:/usr/local/etc/couchdb/local.d# couchdb couchdb 
Apache CouchDB 1.6.1 (LogLevel=info) is starting. 
Apache CouchDB has started. Time to relax. 
[info] [<0.32.0>] Apache CouchDB has started on http://0.0.0.0:8101/ 

然后我尝试将浏览器指向http://0.0.0.0:8101/http://127.0.0.1:5984/_utils/index.html他们都没有工作。

有人可以告诉我为什么我不能查看我的数据库和创建数据库窗口?

回答

3

你对这些东西做行的第一个问题:

# Set port and address for couchdb to bind too. 
# Remember these are addresses inside the container 
# and not necessarily publicly available. 
# See http://docs.couchdb.org/en/latest/config/http.html 
RUN printf "[httpd]\nport = 8101\nbind_address = 0.0.0.0" > 
     /usr/local/etc/couchdb/local.d/docker.ini 


# Tell docker that this port needs to be exposed. 
# You still need to run -P when running container 
EXPOSE 8101 

# This is the command which is run automatically when container is run 
CMD ["/usr/local/bin/couchdb"] 

至于为什么你不能访问它,什么是您的搬运工运行命令的样子,你暴露的端口?即

docker run -p 8101:8101 .... 

你有没有可能在OSX上进行测试?如果是这样,请尝试http://192.168.59.103:8101/由于docker无法在OSX上本地运行,因此OSX docker将位于虚拟框VM内。可以使用boot2docker ip查找虚拟机的IP,通常为192.168.59.103

+0

谢谢@Usman伊斯梅尔,你澄清我的问题! – tkr 2014-09-30 04:19:23

相关问题