gpt4 book ai didi

couchdb - Couchdb墨盒在Docker镜像中无响应

转载 作者:行者123 更新时间:2023-12-02 20:52:17 24 4
gpt4 key购买 nike

我成功地将一个ouchdb盒带部署到了wso2stratos,并且成员被成功激活。对于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网址,它的工作原理非常完美。

我只是通过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,两者均无法正常工作。

有人可以告诉我为什么我无法查看数据库和创建数据库窗口吗?

最佳答案

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

# 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无法在OSX上本地运行,因此docker将在虚拟盒VM中。可以使用boot2docker ip查找虚拟机的IP,通常为 192.168.59.103

关于couchdb - Couchdb墨盒在Docker镜像中无响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26101114/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com