Docker "cgroups: memory cgroup not supported on this system" in CI
Docker tried to apply a memory limit (or just start a container) and found no memory cgroup controller available. The kernel or the nested environment does not expose the memory controller Docker needs.
What this error means
A docker run (especially with --memory) fails with cgroups: memory cgroup not supported on this system. Containers without memory limits may run, but any memory-controlled container cannot start.
docker: Error response from daemon: cgroups: memory cgroup not supported on this
system: unknown.Common causes
Memory cgroup controller not enabled in the kernel
Some minimal or embedded kernels (and certain ARM SBC images) ship with the memory controller disabled, so Docker cannot enforce memory limits.
Controller not delegated to a nested environment
Inside Docker-in-Docker or a constrained runner, the memory controller may not be delegated to the cgroup the daemon runs in, so it appears unsupported.
cgroup v1 with memory disabled at boot
A cgroup_enable=memory boot parameter missing on a cgroup v1 host leaves the memory controller off.
How to fix it
Enable the memory controller at boot (cgroup v1)
Add the kernel boot parameters and reboot so the memory controller is active.
# add to the kernel cmdline (e.g. /boot/cmdline.txt or GRUB):
cgroup_enable=memory cgroup_memory=1
# then reboot the hostDelegate the controller to nested Docker
- For Docker-in-Docker, run the daemon with cgroup delegation / sufficient privilege so the memory controller is available.
- Prefer the host Docker daemon over deeply nested runtimes.
- If you cannot enable it, run containers without
--memory(no memory limit) as a stopgap.
How to prevent it
- Use runner kernels/images with the memory cgroup controller enabled.
- Delegate cgroup controllers when running nested Docker.
- Verify
docker infodoes not warn about a missing memory controller.