Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis on Ubuntu docker: sysctl: setting key "vm.overcommit_memory": Read-only file system

Tags:

docker

redis

Using a container docker based on Ubuntu 14.04 image.

Downloaded Redis from official repository

wget http://download.redis.io/redis-stable.tar.gz

and installed.

Trying to set

sudo sysctl vm.overcommit_memory=1

return

sysctl: setting key "vm.overcommit_memory": Read-only file system

How to solve?

Thank you

like image 482
GabrieleMartini Avatar asked Sep 21 '25 03:09

GabrieleMartini


1 Answers

Only a limited number of sysctl values support namespacing -- that is, can be set in a container without also modifying the host.

All other values will be read-only inside your containers in order to prevent containers from modifying the host configuration. You'll need to set them on the host -- where they will affect the host and all containers.

like image 156
larsks Avatar answered Sep 22 '25 16:09

larsks