On every windows 10 restart I need to type this command sudo sysctl -w vm.max_map_count=262144 in the wsl ubuntu env. I want it to be persistent so I will not need to do it on every restart. I tried to edit /etc/sysctl.conf and in a conf file inside /etc/sysctl.d directory.
I am using Windows 10 (1909), Ubuntu and docker on wsl2 (5.4.72-microsoft-standard-WSL2). Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal