I want to run Elasticsearch 5.0 with my Docker Toolbox. But it requires us to increase the vm.max_map_count to 262144 (https://www.elastic.co/guide/en/elasticsearch/reference/master/vm-max-map-count.html). I can do it by running these commands.
docker-machine ssh default
sysctl -w vm.max_map_count=262144
# Update the vm.max_map_count setting in /etc/sysctl.conf.
But they are reset after I re-boot my host. How to make boot2docker keeps these settings?
You can put it in /var/lib/boot2docker/profile.
How would one put it in there? Is ther something like "EXEC" or so?
Right now the content of /var/lib/boot2docker/profile looks like this:
EXTRA_ARGS='
--label provider=virtualbox
'
CACERT=/var/lib/boot2docker/ca.pem
DOCKER_HOST='-H tcp://0.0.0.0:2376'
DOCKER_STORAGE=aufs
DOCKER_TLS=auto
SERVERKEY=/var/lib/boot2docker/server-key.pem
SERVERCERT=/var/lib/boot2docker/server.pem
Its just sourced as a shell script so you can drop it right in.
EXTRA_ARGS='
--label provider=virtualbox
'
CACERT=/var/lib/boot2docker/ca.pem
DOCKER_HOST='-H tcp://0.0.0.0:2376'
DOCKER_STORAGE=aufs
DOCKER_TLS=auto
SERVERKEY=/var/lib/boot2docker/server-key.pem
SERVERCERT=/var/lib/boot2docker/server.pem
# Update the vm.max_map_count setting
sysctl -w vm.max_map_count=262144
@yosifkit thanks, that was the missing part, I didn't know that one can just put a command there for inside the docker container...
Thank you!
Most helpful comment
Its just sourced as a shell script so you can drop it right in.