在容器中启动一个进程,Centos7 Docker容器中报错 Failed to get D-Bus connection: Operation not permitted
如果要是用systemctl 管理服务就要加上参数 --privileged 来增加权,并且不能使用默认的bash,换成 init,
docker run -d -it --privileged 镜像 /ust/sbin/init
然后在使用exec 进入bash
docker exec -it 容器名 /bin/bash
启动服务
systemctl start nginx
原文:https://www.cnblogs.com/0916m/p/11628778.html