- 开发无止境 -
Data: 2020-10-01 02:21:11Form: JournalClick: 17
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