2017-10-13 784 views

回答

1

如果檢查泊塢窗,撰寫-couch.yaml你會發現,端口已被映射到主機:

couchdb1: 
    container_name: couchdb1 
    image: hyperledger/fabric-couchdb 
    # Comment/Uncomment the port mapping if you want to hide/expose the CouchDB service, 
    # for example map it to utilize Fauxton User Interface in dev environments. 
    ports: 
     - "6984:5984" 

在這種情況下,撰寫文件映射5984爲默認端口的CouchDB 6984在主機上。如果您想檢查本示例中啓動的容器中運行的CouchDB,請在瀏覽器中打開http://localhost:6984/_utils/

+0

非常感謝。我發現docker-compose-couch.yaml中的ports映射就像你說的那樣。 但我仍然無法連接,當我打開http:// localhost:6984/_utils /在我的瀏覽器中。然後,我發現我需要在VirtualBox上設置linux VM和Windows之間的映射。設置映射後,http:// localhost:6984/_utils /是可行的。:) – Tiffany999

+0

啊;-)是的,它在Mac上無縫工作,當我驗證。 – christo4ferris

1

要設置VirtualBox上的端口映射,以下步驟供參考。

  1. 啓動VirtualBox管理器。
  2. 選擇名爲「default」的正在運行的VM。點擊「設置」。選擇「網絡」。
  3. 打開「高級」部分並點擊「端口轉發」。
  4. 單擊「添加新的端口轉發規則」按鈕。然後將主機端口設置爲6984,將訪客端口設置爲5984,作爲the screenshot
相關問題