Docker的centos镜像内无法使用systemctl命令的解决办法

Docker官方的centos镜像内无法使用systemctl命令的解决办法,

使用该命令docker报错

Failed to get D-Bus connection: Operation not permitted

   

   

解决办法:

运行容器时添加参数

--privileged=true

/usr/sbin/init

完成的启动命令为:

docker run -itd --name centos7 --privileged=true centos /usr/sbin/init

猜你喜欢

转载自www.cnblogs.com/withfeel/p/11670692.html