Skip to content

Commit

Permalink
[docker] Allow to change default sysctl parameters using environment …
Browse files Browse the repository at this point in the history
…variables (#3689)
  • Loading branch information
aivarasko committed Sep 10, 2021
1 parent 6b5c855 commit cffe04d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docker/sysctl-setter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ RUN apk add --no-cache procps && echo $'#!/bin/ash\n\
set -e\n\
while true; do\n\
MVAL=$(sysctl -n vm.max_map_count)\n\
if [ "$MVAL" -lt 3000000 ]; then\n\
sysctl -w vm.max_map_count=3000000\n\
MIN_MVAL=${SYSCTL_VM_MAX_MAP_COUNT:-3000000}\n\
if [ "$MVAL" -lt "$MIN_MVAL" ]; then\n\
sysctl -w vm.max_map_count=${MIN_MVAL}\n\
fi\n\
SVAL=$(sysctl -n vm.swappiness)\n\
if [ "$SVAL" -ne 1 ]; then\n\
sysctl -w vm.swappiness=1\n\
fi\n\
FVAL=$(sysctl -n fs.file-max)\n\
if [ "$FVAL" -lt 3000000 ]; then\n\
sysctl -w fs.file-max=3000000\n\
MIN_FVAL=${SYSCTL_FS_FILE_MAX:-3000000}\n\
if [ "$FVAL" -lt "$MIN_FVAL" ]; then\n\
sysctl -w fs.file-max=${MIN_FVAL}\n\
fi\n\
OVAL=$(sysctl -n fs.nr_open)\n\
if [ "$OVAL" -lt 3000000 ]; then\n\
sysctl -w fs.nr_open=3000000\n\
MIN_OVAL=${SYSCTL_FS_NR_OPEN:-3000000}\n\
if [ "$OVAL" -lt "$MIN_OVAL" ]; then\n\
sysctl -w fs.nr_open=${MIN_OVAL}\n\
fi\n\
sleep 60\n\
done' > /bin/m3dbnode_sysctl.sh &&\
Expand Down

0 comments on commit cffe04d

Please sign in to comment.