[英]docker microservice err_connection_refused
I'm trying to test a microservice running from docker. 我正在尝试测试从docker运行的微服务。
Without docker I can access it on http://localhost:9999/
没有docker,我可以在
http://localhost:9999/
上访问它
When I build the image, run it and try the same address http://localhost:9999/
I get err_connection_refused
构建映像时,运行它并尝试使用相同的地址
http://localhost:9999/
我得到err_connection_refused
In my dockerfile I 在我的dockerfile中
EXPOSE 9999
And when running the image I map ports 当运行图像时,我会映射端口
docker run -i -t 6bcb62617b00 -p 9999:9999
But this dosn't help. 但这无济于事。
`Docker-machine` ls returns `tcp://192.168.99.100:2376`
I am using docker quickstart terminal for testing. 我正在使用docker quickstart终端进行测试。 This is the message I get when running the image
Tomcat started on port(s): 9999
这是我
Tomcat started on port(s): 9999
运行图像Tomcat started on port(s): 9999
时收到的消息
Seems like it had something to do with the way I run it. 似乎它与我的运行方式有关。 Here
这里
docker run -d --network=name -p 9999:9999 beeline/dim_source_taxon
Instead of image id I use repository to start microservice and when I try 我使用存储库来启动微服务,而我尝试时使用的不是图像ID
docker ps
Also, instead of localhost
I have to use the host provided by comand docker-machine ls
另外,除了
localhost
我还必须使用comand docker-machine ls
提供的主机
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.