title: Update max_map_count for ElasticSearch docker container Mac host
body: <p>I'm using <a href="https://hub.docker.com/r/_/elasticsearch/" rel="noreferrer">this</a> container to start <code>elasticsearch</code> in <code>docker</code>. In accordance with the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/5.0/vm-max-map-count.html" rel="noreferrer">manual</a> I have to update <code>max_map_count</code> to start the container</p>
  
  <blockquote>
    <p>sudo sysctl -w vm.max_map_count=262144</p>
  </blockquote>
  
  <p>but.. I can update it in my host (container) AFTER I start it while I'm unable to start it. Am I doing something wrong?</p>
  
  <blockquote>
    <p>ERROR: bootstrap checks failed max virtual memory areas
    vm.max_map_count [65530] likely too low, increase to at least [262144]</p>
  </blockquote>
  
  <p>If I try to do it on my host machine (which is Mac) I get the following error.</p>
  
  <blockquote>
    <p>sysctl: unknown oid 'vm.max_map_count'</p>
  </blockquote>
  
  <p>Docker engine installs the Lunix VM where all containers are running. So the command to increase the limit should be executed for the Linux host, not for the Mac.</p>
  
  <p>How can I access Linux VM via terminal installed by the Docker engine?</p>