当前位置:   article > 正文

docker 无法执行systemctl_system has not been booted with systemd as init sy

system has not been booted with systemd as init system (pid 1). can't operat

docker 无法执行systemctl:System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

背景

System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

解决办法

运行容器的时候加上参数--privileged 并且使用/usr/sbin/init 或者/sbin/init ,不要使用/bin/bash
例如debian系列(ubuntu、uos、deepin)
docker run -itd --privileged=true 容器id /sbin/init
例如redhat系列(centos)
docker run -itd --privileged=true 容器id /usr/sbin/init

进入容器依旧使用 /bin/bash

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/573248
推荐阅读
相关标签
  

闽ICP备14008679号