2014-09-29 36 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