max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] - Permanent solution

Viewed 6489

The solution for the error: "max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]" for docker-windows wsl2 is to type the commands:

wsl -d docker-desktop

sysctl -w vm.max_map_count=262144

The problem is that i need to execute it after every system restart....

why the setting removed after every restart? is the docker-desktop container builds again each time?

how can I make it permanent?

Other similar questions regarding linux and not Docker for Desktop on Windows 10 wsl.

2 Answers

See the possible solutions here: Elasticsearch: Max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

Editing the system config (/etc/sysctl.d/99-docker-desktop.conf or /proc/sys/vm/max_map_count) won't survive a Windows system restart, it only survives Docker restart. See here.

You can however use single-node discovery type. Set this in the environment: discovery.type=single-node

docker-compose.yml

services:
  es:
    image: elasticsearch
    environment:
      - discovery.type=single-node

See also:

You can now use the flag SONAR_ES_BOOTSTRAP_CHECKS_DISABLE to disable the check. (Tried with Version 9.4.Community)

$ docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest

Related