咨询热线:4006-75-4006
售前:9:00-23:30 备案:9:00-18:00 技术:7*24h
docker报错:Failed to get D-Bus connection Operation not permitted的解决办法
问题:
Docker使用centos7镜像创建容器后,在里面使用systemctl启动服务报错:
Failed to get D-Bus connection: Operation not permitted
问题复现:
#docker run -itd --name centos7 centos:7
#docker attach centos7
#yum install vsftpd
#systemctl start vsftpd
报错:Failed to get D-Bus connection: Operation not permitted
解决办法:
先把原先创建的容器停止服务并移除
#docker stop centos7
#docker rm centos7
以特权模式运行容器。
#docker run -d --name centos7 --privileged=true centos:7
进入容器:
#docker exec -it centos7 / bin / bash
#yum install vsftpd
#systemctl start vsftpd
启动正常。