Docker 报错

Docker 启动或者重启时报以上两个错误:

  • Error starting daemon: Devices cgroup isn't mounted
  • Error response from daemon: Cannot restart container rsnmp_v4: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:297: applying cgroup configuration for process caused \"mountpoint for devices not found\"": unknown

问题都是 cgroup 未挂载。可以通过下面命令脚本修复。

执行以下命令完成修复

  1. bash -c "$(curl -sS https://gitee.com/lwmacct/web-vscode-shell/raw/main/workspace/shell/centos/docker/cgroupfs-mount.sh)"
  1. bash -c "$(curl -sSL https://raw.githubusercontent.com/tianon/cgroupfs-mount/master/cgroupfs-mount)"

参考链接:https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount