Vm.max_map_count in Dockerfile


(Rachel Kelly) #1

Hello all, we are running Elasticsearch in a Docker container on an AWS EC2 instance in an ECS cluster using a Cloudformation template. AWS jargon aside, I can't find an automated way to add vm.max_map_count to the Cloudformation template. Please find this ES discuss thread which talks about some of the limitations for a little more background, though some pieces are Windows specific and apply as little as mac-specific tips do.

I would like it to be part of a RUN layer in the Dockerfile since it is just a system-level command, but there is a note about it in the official Elastic.co Dockerfile:

35: # don't allow the package to install its sysctl file (causes the install to fail)
36: # Failed to write '262144' to '/proc/sys/vm/max_map_count': Read-only file system

I THINK I've seen something that the above error is Mac-host-specific, probably to do with the fact that there is no /proc/ on a mac.

If worse comes to worse, this can be a manual step on the AWS Linux image I'm creating, but I want to put it in as part of the build as it's entirely Elasticsearch-specific. My goal is halfway to submit a PR (is that possible or ever welcome? haha I do not know), or at least an Issue request, which includes sysctl -w vm.max_map_count=262144 in a RUN layer in the Dockerfile, but I want to know why that's not possible, and if there's a way to automate Elasticsearch in a Docker container on an EC2 instance. FYI we cannot use AWS' elasticsearch service for compliance reasons.

Happy to include more info. Thank you in advance!


(system) #2

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