错误如下:

sudo docker run hello-world

docker: Error response from daemon: cgroups: cgroup mountpoint does not exist: unknown.

ERRO[0000] error waiting for container: context canceled

解决方法:

sudo mkdir /sys/fs/cgroup/systemd

sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd

然后在跑就正常了

docker报错:cgroup mountpoint does not exist_报错

注意:此方法在系统重启后mount point就会消失,而且systemd文件夹也会被自动删除,因此我使用脚步自动添加的方式

将上面2条命令创建一个shell脚本,添加crontab,每次重启时自动加载

docker报错:cgroup mountpoint does not exist_报错_02

crontab中的设置:

docker报错:cgroup mountpoint does not exist_cgroup_03