问题描述
在docker镜像centos:centos7
安装 mysql5.7.31
# 启动mysql服务会卡主 systemctl start mysqld # 查看状态会报错 systemctl status mysqld New main PID 398 does not belong to
解决方案
添加参数-v /sys/fs/cgroup:/sys/fs/cgroup:ro
# macOS docker run -itd \ --privileged \ -p 8082:8080 \ -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ --name centos7.2 \ centos:centos7 /usr/sbin/init # 进入终端 docker exec -it centos7.2 /bin/bash
参考