繁体   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