伐柯伐柯*其則不遠*我覬之子*籩豆有踐

9 , 4月2018

fedora31使用docker

sudo docker run hello-world docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused “process_linux.go:449: container init caused \”process_linux.go:415: setting cgroup config for procHooks process caused \\\”error while setting cgroup v2: [failed to load program: operation not permitted]\\\”\””: unknown. ERRO[0000] error waiting for container: context canceled

Linux 4.5内核正式启用了cgroups v2,而目前docker并不支持cgroups v2。

在使用4.5+内核的发行版本上(例如fedora31+)启动docker容器会遇到如下报错:

$  sudo docker run hello-world
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"process_linux.go:415: setting cgroup config for procHooks process caused \\\"error while setting cgroup v2: [failed to load program: operation not permitted]\\\"\"": unknown.
ERRO[0000] error waiting for container: context canceled

这种情况要么只能切回cgroups1,要么就必须使用兼容工具podman。

如果切回cgroups v1只需要执行如下操作:

sudo dnf install grubby

sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"

内核参数改动后重启host,docker就可以正常使用了。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

© 2011 - 2024 laijim.com