Hi,
I am struggling adding elastic agent on docker. All the times I try to docker run the agent this error appears:
< "failed version compatibility check with elasticsearch: dial tcp localhost:9200: connect: connection refused" >
The command used is:
docker run --env FLEET_SERVER_ENABLE=true --env FLEET_SERVER_SERVICE_TOKEN=[TOKEN] --env FLEET_SERVER_POLICY_ID=[POLICY-ID] --env FLEET_SERVER_ELASTICSEARCH_HOST=localhost --env FLEET_INSECURE=true -p 8220:8220 --rm docker.elastic.co/beats/elastic-agent:8.12.2
I cannot write properly the hosts due to post url restriction but the above localhost is http.
Unable to load docker-compose.yml for the same reason
Answering to @cmacknz from GitHub issue port 9200 should still be exposed in the docker-compose file. Do I need to use "expose" instead of "ports" ? By the way I am able to curl http:// localhost:9200 from the host machine and, even receiving an empty response my action is logged by Elasticsearch. When I try to docker run the elastic agent nothing is logged.