简体   繁体   English

Mac的Docker无法转发端口

[英]Docker for Mac not forwarding ports

I'm trying to start elasticsearch 2.4.6 on my Mac (HighSierra). 我正在尝试在Mac(HighSierra)上启动elasticsearch 2.4.6。

Using: Docker Kitematic 0.17.2, Docker for Mac 18.06.1 使用:Docker Kitematic 0.17.2,适用于Mac的Docker 18.06.1

After I download and run selected image in container I have 下载并运行容器中的选定图像后,

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES dc5e1f90ce24 elasticsearch:2.4.6 "/docker-entrypoint.…" 13 hours ago Up 3 minutes 0.0.0.0:32782->9200/tcp, 0.0.0.0:32781->9300/tcp elasticsearch

But Elastic cannot be reached out on 9200, 9300 但是在9200、9300上无法触及Elastic

curl 'http://localhost:9200/?pretty' curl: (7) Failed to connect to localhost port 9200: Connection refused

curl 'http://0.0.0.0:9200/?pretty' curl: (7) Failed to connect to 0.0.0.0 port 9200: Connection refused

Isn't 0.0.0.0 should be available? 0.0.0.0是否应该可用?

The answer was pretty clear, thanks Val . 感谢Val ,答案很明确。 But to make it easier I changed in Kitematic mapping ports to 9200, 9300, so now I have 但是为了简化起见,我将Kitematic映射端口更改为9200、9300,所以现在我有了

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a817c85926dc elasticsearch:2.4.6 "/docker-entrypoint.…" 4 minutes ago Up 4 minutes 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp elasticsearch

As I expected 如我所料

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM