有关Docker容器内不能使用Systemctl等命令的解决方法
systemctl start mysql
System has not been booted with systemd as init system (PID 1). Can't operate
解决方法
有两种
- 使用service代替systemctl
service mysql start
- 赋予特权并在init中启动
docker run -it --privileged=true -h node02 --ip 172.18.0.2 --name node02 ubuntu:v1 /usr/sbin/init