简体   繁体   English

boot2docker在本地主机上访问elasticsearch

[英]boot2docker access elasticsearch on localhost

I'm running boot2docker on a Mac for my development. 我正在Mac上运行boot2docker进行开发。 I built a Docker image containing a Jetty server which is connecting to elasticsearch at localhost together with Redis and MySQL. 我建立包含被连接到在一个elasticsearch 码头服务器泊坞图像localhost与Redis的和MySQL在一起。

I'm running docker-compose with a host bridge configuration which looks like the following: 我正在使用主机桥配置运行docker-compose ,如下所示:

 api:
  image: api
  ports:
    - "8080:8080"
  environment:
   JETTY_ENVIRONMENT: dev
  net: "host" 

What I want is accessing elasticsearch which I installed on my Mac via localhost:9200 . 我要的是访问,我通过我的Mac上安装elasticsearch localhost:9200

Try this? 尝试这个? I know we're not supposed to answer with links, but I thought it'd be OK since it's a link to a boot2docker file on Github. 我知道我们不应该用链接回答,但是我认为可以,因为它是Github上boot2docker文件链接。

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

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