解決 docker內 運行 php服務 時 Failed to get D-Bus connection: Operation not permitted

sh-4.2# systemctl start php-fpm.service
Failed to get D-Bus connection: Operation not permitted
sh-4.2# history 
    1  ping www.baidu.com
    2  cat /etc/redhat-release
    3  yum install epel-release -y
    6  rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    7  yum -y -y remove php*
    8  yum -y remove php*
   10  yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml
   11  systemctl enable php-fpm.service
   14  systemctl start php-fpm.service
   15  php -v
   16  systemctl start php-fpm.service

解決方法:# docker run -d -name centos7 --privileged=true centos:7 /usr/sbin/init

容器運行時要添加上面紅色部分

 


 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章