# Elasticsearch in Docker on Jenkins fails health check

**URL:** <https://discuss.elastic.co/t/elasticsearch-in-docker-on-jenkins-fails-health-check/132107>\
**Category:** Elasticsearch\
**Created:** [May 16, 2018, 11:45am UTC](https://discuss.elastic.co/t/elasticsearch-in-docker-on-jenkins-fails-health-check/132107 "2018-05-16T11:45:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![austinmodo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/austinmodo/32/31263_2.png) [@austinmodo](https://discuss.elastic.co/u/austinmodo)\
**Post date:** [May 16, 2018, 11:45am UTC](https://discuss.elastic.co/t/elasticsearch-in-docker-on-jenkins-fails-health-check/132107/1 "2018-05-16T11:45:30Z")

</div>

I am using Elasticsearch and docker-compose inside a Jenkins pipeline to run my tests. Both Elasticsearch and the Node.js service seem to start properly from Docker, but performing a health check by hitting the [http://elasticsearch:9200/\_cat/health?h=st](http://elasticsearch:9200/_cat/health?h=st) endpoint returns status code 000 from curl.

Running the tests and performing the health check from inside docker on local (macOS with Docker for Mac) working completely fine, but in Jenkins the health checks fail. Here is what my setup (with error log) looks like:

> <https://gist.github.com/austinkelleher/ae592eed024328bb738e3bef4dc0af4c>
>
> There are more than three files. show original

The entry point is run-tests.sh

Anypointers would be extraordinarily appreciated.

(Also posted on StackOverflow if you would prefer to chime in there: [https://stackoverflow.com/questions/50369125/elasticsearch-in-docker-on-jenkins-fails-health-check](https://stackoverflow.com/questions/50369125/elasticsearch-in-docker-on-jenkins-fails-health-check)

---

<div class="post-metadata">

**Author:** ![austinmodo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/austinmodo/32/31263_2.png) [@austinmodo](https://discuss.elastic.co/u/austinmodo)\
**Post date:** [May 16, 2018, 3:29pm UTC](https://discuss.elastic.co/t/elasticsearch-in-docker-on-jenkins-fails-health-check/132107/2 "2018-05-16T15:29:09Z")

</div>

I was able to solve the connection issue by adding `environment: ['transport.host=127.0.0.1']` to the `elasticsearch` service. See my comment in the gist: [https://gist.github.com/austinkelleher/ae592eed024328bb738e3bef4dc0af4c#gistcomment-2591254](https://gist.github.com/austinkelleher/ae592eed024328bb738e3bef4dc0af4c#gistcomment-2591254)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 13, 2018, 3:29pm UTC](https://discuss.elastic.co/t/elasticsearch-in-docker-on-jenkins-fails-health-check/132107/3 "2018-06-13T15:29:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
