Docker memory limits


I’m trying to use the --memory and --memory-swap parameters of Docker to limit the container’s RAM/swap size.

For this to work Docker needs cgroups enabled in the Linux kernel. There’s explanations on the net for Ubuntu to set kernel parameters in GRUB_CMDLINE_LINUX in /etc/default/grub, update-grub and reboot to get this.

But now how do I do this on Travis and bionic ? I cannot reboot the VM, can I ?
Any other means to pass kernel parameters on first VM boot ?