Using the existing docker image does not accept positional arguments for Elasticsearch environment variables correctly. The documentation states that we should be able to pass the arguments in with this command
docker run --rm --name es8 --net elastic -p 9200:9200 -p 9300:9300 -it elasticsearch:8.1.2 bin/elasticsearch -Ediscovery.type=single-node -Expack.security.enabled=false
However security is enabled (confirmed via logs) and the server fails to start.
{"@timestamp":"2022-04-14T14:47:25.182Z", "log.level": "INFO", "message":"Security is enabled", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"main","log.logger":"org.elasticsearch.xpack.security.Security","elasticsearch.node.name":"0e0953f434a9","elasticsearch.cluster.name":"docker-cluster"}
...
ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log
A custom Dockerfile with the environment variables set works and correctly starts with security disabled
FROM elasticsearch:8.1.2
ENV xpack.security.enabled=false discovery.type=single-node
Also, using variable names in the CI tool like this works correctly, but I believe there is still a bug around what documentation states and how the image works.
ES_SETTING_DISCOVERY_TYPE: "single-node"
ES_SETTING_XPACK_SECURITY_ENABLED: "false"