Elasticsearch vm.max_map_count error in docker image on MacOS 14

Hello!
I have the "vm.max_map_count [65530] is too low, increase to at least [262144]" error while elastic container starting on Docker 4.25, MacOS 14 and ARM core.

Here is my container props:

    image: elasticsearch:8.9.0
    container_name: elasticsearch
    hostname: elastic
    environment:
      - node.name=elasticsearch
      - cluster.name=es-docker-cluster
      - cluster.initial_master_nodes=elasticsearch
      - bootstrap.memory_lock=true
      - 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - es-data:/usr/share/elasticsearch/data
    ports:
      - ${DC_ELASTIC_HOST_PORT}:${DC_ELASTIC_PORT}

I've tried the steps described here: Install Elasticsearch with Docker | Elasticsearch Guide [8.10] | Elastic
But it does not helps.

command docker-machine ssh fails by Error: No machine name(s) specified and no "default" machine exists . Seems to vm machine must be created, but it requires VirtualBox that runs only on Intel core Macs.
command screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty fails due to path not found.
command sudo sysctl -w vm.max_map_count=262144 fails by sysctl: unknown oid 'vm.max_map_count'error too.

May be somebody knows any another solution ?

Here is solution

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.