0
点赞
收藏
分享

微信扫一扫

docker报错:System has not been booted with systemd as init system (PID 1). Can‘t operate.

docker使用centos7命令 systemctl 报错

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

解决方式

# 运行centos
# docker run -itd --name centos centos /bin/bash

# 替换为:
# 获取systemctl权限
docker run --privileged -itd --name centos centos /usr/sbin/init

# 进入终端
docker exec -it centos /bin/bash

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

举报

相关推荐

0 条评论