docker报错 Failed to get D-Bus connection: Operation not permitted
[root@qqqqqqqqqqqq ~]# docker run -d -p 80:80 local/c7-systemd-httpd[root@qqqqqqqqqqqq ~]# docker exec -it 80 bash[root@80185599c949 /]# yum -y install memcached进入到容器内,安装了memcached后报错[root@801...
·
[root@qqqqqqqqqqqq ~]# docker run -d -p 80:80 local/c7-systemd-httpd
[root@qqqqqqqqqqqq ~]# docker exec -it 80 bash
[root@80185599c949 /]# yum -y install memcached
进入到容器内,安装了memcached后报错
[root@80185599c949 /]# systemctl start memcached
Failed to get D-Bus connection: Operation not permitted
原因及解决方式:
这个的原因是因为dbus-daemon没能启动。其实systemctl并不是不可以使用。将你的CMD或者entrypoint设置为/usr/sbin/init即可。会自动将dbus等服务启动起来。
启动时候增加 --privileged
[root@qqqqqqqqqqqq ~]# docker run -d --privileged -p 80:80 local/c7-systemd-httpd
更多推荐
已为社区贡献8条内容
所有评论(0)