Skip to content

Instantly share code, notes, and snippets.

@phellipeandrade
Created December 1, 2017 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phellipeandrade/d069407b7888718a15b47c43fe8491eb to your computer and use it in GitHub Desktop.
Save phellipeandrade/d069407b7888718a15b47c43fe8491eb to your computer and use it in GitHub Desktop.
https://github.com/docker-library/kibana/issues/65
Correct, your host can access elasticsearch via localhost since you forwarded the ports with -p 9200:9200 -p 9300:9300, but kibana has its own network interface and localhost in the kibana container is just kibana, not your host.
You need to either give the ip of your elasticsearch container to kibana:
$ docker run -d -v "$PWD/esdata":/usr/share/elasticsearch/data -p 9200:9200 -p 9300:9300 --name elastic elasticsearch
$ ip="$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' elastic)"
$ docker run -e ELASTICSEARCH_URL="http://$ip:9200" -p 5601:5601 -d --name kib kibana
or use linking dns so that kibana can resolve a name to elasticsearch:
$ docker run -d -v "$PWD/esdata":/usr/share/elasticsearch/data -p 9200:9200 -p 9300:9300 --name elastic elasticsearch
$ docker run --link elastic:elastic-url -e ELASTICSEARCH_URL="http://elastic-url:9200" -p 5601:5601 -d --name kib kibana
or docker dns on a network:
$ docker network create elk
$ docker run -d -v "$PWD/esdata":/usr/share/elasticsearch/data -p 9200:9200 -p 9300:9300 --name elastic --net elk elasticsearch
$ docker run -e ELASTICSEARCH_URL="http://elastic:9200" -p 5601:5601 -d --name kib --net elk kibana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment