| 原因
报错 System has not been booted with systemd as init system (PID 1). Can't operate. 解决办法 docker run -itd --privileged --name myCentos centos /usr/sbin/init docker exec -it myCentos /bin/bash 在容器中安装服务启动
|
System has not been booted with systemd as init system (PID 1). Can‘t operat
最新推荐文章于 2024-05-25 15:16:42 发布
本文解决了在Docker容器内使用systemctl时遇到的问题。由于默认执行/bin/bash导致systemctl无法正常工作,通过使用--privileged并指定/usr/sbin/init作为入口点来解决此问题。

2万+

被折叠的 条评论
为什么被折叠?



