OpenMediaVault-Plugin-Developers / openmediavault-omvextrasorg

OpenMediaVault plugin for omv-extras.org repository
150 stars 53 forks source link

Feature: Enable memory cgroup installing docker in Raspberrypi devices #75

Closed ConsoleXXVII closed 1 year ago

ConsoleXXVII commented 2 years ago

Adding cgroup_enable=memory as a boot parameter to the kernel lets portainer watch how many RAM memory is used by every container. So for Raspberry devices this option should be added in: /boot/cmdline.txt

Code could be (to check):

Enable cgroup for RaspberryPi

if [[ -f '/boot/cmdline.txt' ]] then grep -Eq '(^|[[:blank:]])cgroup_enable=memory([[:blank:]]|$)' /boot/cmdline.txt || sed -i '/root=/s/[[:blank:]]*$/ cgroup_enable=memory/' /boot/cmdline.txt

To add at line 415 of the file at /usr/sbin/omv-installdocker

ryecoaaron commented 2 years ago

I honestly don't think omv-extras should be doing this. This should be a default for the RPi if it is so helpful with so many people running docker on them. I don't want to start maintaining single system tweaks in omv-extras since it runs on everything.

ConsoleXXVII commented 2 years ago

Yes, make sense. I will continue to fix it manually.

Thanks