0
votes

I create a container with ubuntu's image.

That's all right, and i can use very well.

So, i install a elasticsearch service in this ubuntu's docker.

I have a ubuntu docker. I install elasticsearch service it.

When i use the command "curl -X GET 'localhost:9200' ", it return me the version, the name, all right.

It means the elasticsearch is configured correct, but when i access on my browser out of docker , doesn't work.

I have already configured the network on elasticsearch.yml file in path: /etc/elasticsearch/elasticsearch.yml

I can access the service with:

curl -X GET 'localhost:9200' and run correct, but when i try to access out of container , i can't found the page.

I try to use the command:

docker run -p 9200:9200 -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" ubuntu/elastic

But doesn't work.

1
Expose your port 9200 and then access the docker IP (you can find this IP with "ifconfig" command on your host) then you should be able to acces your ES from outside "curl -X GET 'DOCKER_IP:9200' ". - Dado

1 Answers

0
votes

you have to set/add in elasticsearch.yml bind address same as ip address of container. Because now is elasticsearch listening only on localhost inside a docker.