Docker -- WARNING: No swap limit support

Swap limit support allows you to limit the swap the container uses, see https://docs.docker.com/engine/admin/resource_constraints

According to https://docs.docker.com/engine/installation/linux/linux-postinstall/#your-kernel-does-not-support-cgroup-swap-limit-capabilities :

You can enable these capabilities on Ubuntu or Debian by following these instructions. Memory and swap accounting incur an overhead of about 1% of the total available memory and a 10% overall performance degradation, even if Docker is not running.

1) Log into the Ubuntu or Debian host as a user with sudo privileges.

2) Edit the /etc/default/grub file. Add or edit the GRUB_CMDLINE_LINUX line to add the following two key-value pairs:

GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"

3) Update GRUB.

$ sudo update-grub

On my Google Cloud Compute instance I had to do it a little bit different than the accepted answer.

1) edit the file /etc/default/grub.d/50-cloudimg-settings.cfg

sudo nano /etc/default/grub.d/50-cloudimg-settings.cfg

1.1) modify or create the line

GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0 cgroup_enable=memory swapaccount=1"

1.2) save

2) update grup

sudo update-grub

3) reboot

sudo reboot

Tags:

Docker

Swap