Setting kernel command line

August 15, 2014 5.3k views

Hello all,

I'm trying to set memory limits on Docker containers running within my (Ubuntu) droplet. When I do this currently, I get the following warning:

WARNING: Your kernel does not support swap limit capabilities. Limitation discarded.

The fix for this is to set "cgroup_enable=memory swapaccount=1" in the command-line of the kernel (source).

I've updated /etc/default/grub to include these in my GRUB_CMDLINE_LINUX and have run update-grub; I can see the appropriate entries in the generated configuration in /boot. However, when I reboot the machine:

$ cat /proc/cmdline
root=LABEL=DOROOT ro

Is there anything I can do to set the command line parameters myself?

2 comments
  • I've tried a shutdown and boot up as well, to no avail.

  • I guess there is no way to modify the kernel command line from within the droplet. This can only be done from the host system which DO controls. That's also why you can't boot your own kernel images, only select a few from the control center. You could even remove all linux-image* and grub packages from the droplet and it would still work.

1 Answer

Hi!

Due to the virtualization technology that we use, the kernel running on the droplet must match what is being run on the hypervisor level. Boot parameters must be passed on the hypervisor. If you open a support ticket, the team should be able to get you squared away.

  • I should also note that for this specific issue, we do provide kernels that will boot with cgroup_enable=memory swapaccount=1 They can be enabled using the same process as updating your kernel. Just look for the kernels with docker-memlimit` in their name:

    If you use the Docker One-Click app, they will be used by default.

Have another answer? Share your knowledge.