System has not been booted with systemd as init system (PID 1). Can‘t operate. Failed to connect to
问题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解决方法docker启动方式需要变化。启动时添加 --privileged=true 和 /sbin/ini
·
问题
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
解决方法
docker启动方式需要变化。启动时添加 --privileged=true
和 /sbin/init
后面/bin/bash
需要替换为/sbin/init
即由此方式:
docker run -tid --name test centos /bin/bash
变更为:
docker run -tid --name test --privileged=true centos /sbin/init
更多推荐
所有评论(0)