Passing ES_JAVA_OPTS variable with spaces when using docker compose Passing ES_JAVA_OPTS variable with spaces when using docker compose elasticsearch elasticsearch

Passing ES_JAVA_OPTS variable with spaces when using docker compose


According to https://github.com/docker/compose/issues/2854, it's an issue with how docker compose will parse your env variables.

If you switch to yaml map instead of list, it should work:

elasticsearch:  image: "docker.elastic.co/elasticsearch/elasticsearch:5.4.3"  ports:    - "6379:6379"  environment:    http.host: 0.0.0.0    transport.host: 127.0.0.1    xpack.security.enabled: "false"    ES_JAVA_OPTS: -Xms512m -Xmx512m