【问题标题】:Couchdb cartridge not responding in docker imageCouchdb 墨盒在 Docker 映像中没有响应
【发布时间】:2014-09-29 13:29:15
【问题描述】:

我成功地为 wso2stratos 部署了一个 couchdb 磁带,并且成员成功激活。对于 dockerfile 的实现,我使用了this git 代码。其中包括以下行,我不知道它为什么在那里!有人能解释一下下面的代码吗?

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 连接到 docker 容器并启动 couchdb,

 root@instance-00000001:/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,它们都不起作用。

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

【问题讨论】:

    标签: couchdb docker openstack paas wso2stratos


    【解决方案1】:

    关于这些行的作用的第一个问题:

    # 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 命令是什么样子的,你暴露了端口吗?即

    docker run -p 8101:8101 ....
    

    您是否有机会在 OSX 上进行测试?如果是这样,请尝试http://192.168.59.103:8101/ 在 OSX 上,docker 将位于虚拟机 VM 内,因为 docker 无法在 OSX 上本地运行。虚拟机的IP可以通过boot2docker ip查到,一般为192.168.59.103

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-10
      • 1970-01-01
      • 2020-11-12
      • 1970-01-01
      • 1970-01-01
      • 2020-12-01
      • 1970-01-01
      相关资源
      最近更新 更多