Docker报错之“Failed to get D-Bus connection: Operation not permitted”

今天打算在容器里安装ssh服务,正当我打算systemctl start sshd时,

Failed to get D-Bus connection: Operation not permitted

纳尼???不让操作???

突然想起来我之前总结的Docker篇之docker容器里有介绍过,

--privileged=true

但是要注意,这是在创建容器时才有得选项

给容器最高特权

docker run -it --name sshd_centos --privileged=true centos:centos7 bash
[root@7ae11083972b /]# 
posted @ 2020-10-31 17:06  开心burukku  阅读(2662)  评论(0编辑  收藏  举报