Bootstrap Check Failure 1 max Virtual Memory Areas vm.max_map_count in Docker
When start the Elasticsearch in a Docker container in Linux instance generated an error below,
ERROR:  bootstrap checks failed. You must address the points described in the following  lines before starting Elasticsearch.
bootstrap check failure  of : max virtual memory areas vm.max_map_count  is too low, increase to at least 
ERROR: Elasticsearch did not exit normally - check the logs at /opt/sonarqube/logs/sonarqube.log
Let us see why the above error is generated in a Docker container which contains Elasticsearch,
The Elasticsearch use a mmapfs directory to store its indices. By default in a Linux operating system limits on mmap counts to be very low, which may result in out of memory. That's the reason we have received the output on the docker container logs.
Lets increase the limits max_map_count count in your Linux machine by running the following command as root user:
# sysctl -w vm.max_map_count=262144
Also, can set the above value permanently, add the same value in /et/sysctl.conf file. Open a file and use any editor, likely vim/vi/nano,
# vim /et/sysctl.conf
update the value,
The RPM and Debian packages will configure this setting automatically. No further configuration is required.
then, start the Elasticsearch docker container,
$ docker container start elasticsearch