diff --git a/libbeat/docker-compose.yml b/libbeat/docker-compose.yml index be4c0be7dfa0..a2d02fc448fe 100644 --- a/libbeat/docker-compose.yml +++ b/libbeat/docker-compose.yml @@ -65,14 +65,13 @@ services: file: ${ES_BEATS}/testing/environments/${TESTING_ENVIRONMENT}.yml service: elasticsearch healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:9200"] - + test: ["CMD-SHELL", "curl -s http://localhost:9200/_cat/health?h=status | grep -q green"] elasticsearchssl: extends: file: ${ES_BEATS}/testing/environments/${TESTING_ENVIRONMENT}.yml service: elasticsearch healthcheck: - test: ["CMD", "curl", "-u", "admin:changeme", "-f", "https://localhost:9200", "--insecure"] + test: ["CMD-SHELL", "curl -u admin:changeme -f http://localhost:9200/_cat/health?h=status --insecure | grep -q green"] retries: 1200 interval: 5s start_period: 60s diff --git a/testing/environments/latest.yml b/testing/environments/latest.yml index adf6a1883798..2394f49f4022 100644 --- a/testing/environments/latest.yml +++ b/testing/environments/latest.yml @@ -5,7 +5,7 @@ services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0 healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:9200"] + test: ["CMD-SHELL", "curl -s http://localhost:9200/_cat/health?h=status | grep -q green"] retries: 300 interval: 1s environment: diff --git a/testing/environments/snapshot-oss.yml b/testing/environments/snapshot-oss.yml index a95b4c9f33dc..078b8f8adf68 100644 --- a/testing/environments/snapshot-oss.yml +++ b/testing/environments/snapshot-oss.yml @@ -5,7 +5,7 @@ services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch-oss:8.0.0-SNAPSHOT healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:9200"] + test: ["CMD-SHELL", "curl -s http://localhost:9200/_cat/health?h=status | grep -q green"] retries: 300 interval: 1s environment: diff --git a/testing/environments/snapshot.yml b/testing/environments/snapshot.yml index 16c20266a6e6..959a2c399322 100644 --- a/testing/environments/snapshot.yml +++ b/testing/environments/snapshot.yml @@ -5,7 +5,7 @@ services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:9200"] + test: ["CMD-SHELL", "curl -s http://localhost:9200/_cat/health?h=status | grep -q green"] retries: 300 interval: 1s environment: diff --git a/x-pack/libbeat/docker-compose.yml b/x-pack/libbeat/docker-compose.yml index 8accd638f14d..81b6960c90ce 100644 --- a/x-pack/libbeat/docker-compose.yml +++ b/x-pack/libbeat/docker-compose.yml @@ -29,7 +29,7 @@ services: file: ${ES_BEATS}/testing/environments/${TESTING_ENVIRONMENT}.yml service: elasticsearch healthcheck: - test: ["CMD-SHELL", "curl http://myelastic:changeme@localhost:9200/_cat/health?h=status | grep -q green"] + test: ["CMD-SHELL", "curl -u myelastic:changeme -f http://localhost:9200/_cat/health?h=status | grep -q green"] retries: 1200 interval: 5s start_period: 60s