Docker CI: 安装 SonarQube 异常 max virtual memory areas vm.max_map_count [65530] is too low
一、问题
# docker logs sonarqube_sonarqube_1
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 /opt/sonarqube/logs/sonarqube.log
二、原因
Elasticsearch 虚拟内存需要至少[262144]
三、解决方案
在宿主机上修改 /etc/sysctl.conf
# vim /etc/sysctl.conf
vm.max_map_count=262144
# /sbin/sysctl -p
四、问题解决
2022.11.29 04:04:03 INFO web[][o.s.s.p.ServerPluginManager] Deploy C# Code Quality and Security / 8.46.0.54807 / a9f10bf0c980dd16d428c08c7a984e2205a512df
2022.11.29 04:04:03 INFO web[][o.s.s.p.ServerPluginManager] Deploy Configuration detection fot Code Quality and Security / 1.2.0.267 / 4f37ba9ffb37a96d5883e52ad392ed32c5c6eaab
2022.11.29 04:04:03 INFO web[][o.s.s.p.ServerPluginManager] Deploy Flex Code Quality and Security / 2.7.0.2865 / 9e61d9774455b25eefd0b71bf8903cb030641864
2022.11.29 04:04:03 INFO web