From 1567463f49890842b430e7669cd79a582f3ef020 Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Mon, 5 Apr 2021 02:06:51 +0200 Subject: [PATCH] Use proc fs to access sysctl values, to be able to query whether the variables we want to write are exposed and writable at all. --- docker-compose/elk-configure-host/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose/elk-configure-host/Dockerfile b/docker-compose/elk-configure-host/Dockerfile index 03e2b378f..269032484 100644 --- a/docker-compose/elk-configure-host/Dockerfile +++ b/docker-compose/elk-configure-host/Dockerfile @@ -1,4 +1,4 @@ FROM ubuntu:20.04 # Expand VM settings as required by ELK -CMD bash -c "if test $(sysctl -n vm.max_map_count) -lt 262144; then sysctl -w vm.max_map_count=262144; fi" +CMD bash -c "if [ -w /proc/sys/vm/max_map_count ] && [ $(cat /proc/sys/vm/max_map_count) -lt 262144 ]; then echo 262144 > /proc/sys/vm/max_map_count; fi" -- GitLab