docker创建镜像,无法使用systemctl命令

2024-10-13 22:25:36

1、报错现象:[root@b8e2e0f6ac9f /]# systemctl status sshdFailed to get D-Bus connection: Operation not permitted[root@b8e2e0f6ac9f /]#

docker创建镜像,无法使用systemctl命令

2、启动方式有问题,应该使用 --privileged 参数来启动docker镜像,具体命令如下:docker run --privileged -itd centos:7 /usr/sbin/init

docker创建镜像,无法使用systemctl命令

3、这样子的话就可以了~~~

猜你喜欢