Docker容器centos或unbuntu无法使用 systemctl 命令解决方案
容器内使用systemctl 命令时出现(System has not been booted with systemd as init system (PID 1). Can't operat....信息。解决方案:/sbin/init例如:Centos8docker run -itd --name centos --privileged=true centos /sbin/initdocker
·
容器内使用systemctl 命令时出现(System has not been booted with systemd as init system (PID 1). Can't operat....信息。
解决方案:/sbin/init
例如:Centos8
docker run -itd --name centos --privileged=true centos /sbin/init
docker exec -it centos /bin/bash
注意:--privileged=true一定要加上的。
余生很长,请多指教(微信公众号:灵心师)
更多推荐
已为社区贡献2条内容
所有评论(0)