我正在本地在docker安装程序中运行应用程序[在Mac中使用homebrew安装了docker]。
我从邮递员那里获得了Could not get any response
或在curl呼叫中获得了Empty 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
您有错误的端口映射。好像您的图像暴露了端口8080。但是您将8085映射到8085。
代替:
expose:
- 8085
ports:
- target: 8085
published: 8085
protocol: tcp
mode: hosts
写
ports:
- 8085:8080