簡體   English   中英

docker-machine - 無法連接到rest url

[英]docker-machine - unable to connect to rest url

我在本地運行 docker setup 中的應用程序 [在 Mac 中使用自制軟件安裝 docker]。

我在 curl 調用中Could not get any response郵遞員的Could not get any responseEmpty reply from server

我嘗試了docker-machine: Can't access container's web server from host 中提到的所有解決方案,但沒有一個對我有用。 我不知道為什么我無法訪問該 URL。

我正在附加 docker ps 和 docker-machine env 輸出。

在此處輸入圖片說明

我還附上了我的 docker-compose.yml

version: '3.2'
services:
  details:
    image:  localhost:5000/my-details-1
    container_name: details
    #build: ./details
    expose:
      - 9080
  ratings:
    image: localhost:5000/my-ratings-1
    container_name: ratings
    #build: ./ratings
    expose:
      - 9080
  reviews:
    image: localhost:5000/my-reviews-1
    container_name: reviews
    #build: ./reviews/reviews-wlpcfg
    expose:
      - 9080
  restwrapjdbc:
    image: localhost:5000/my-restwrapjdbc
    container_name: restwrapjdbc
    #build: ./RestWrapJDBC
    expose:
      - 8085
  mirest:
    image: localhost:5000/my-mirest
    container_name: mirest
    #build: ./MIRest
    #network_mode: "host"
    expose:
      - 8085
    ports:
      - target: 8085
        published: 8085
        protocol: tcp
        mode: hosts

編輯:

我忘了包含web.xmlurl-pattern 將該字符串包含到 url 中有效。

你有錯誤的端口映射。 似乎您的圖像暴露了端口 8080。但是您將 8085 映射到 8085。

反而:

expose:
      - 8085
ports:
      - target: 8085
        published: 8085
        protocol: tcp
        mode: hosts

ports:
      - 8085:8080

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM