在容器中安装的服务启动不了

在容器中启动一个进程,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

posted @ 2019-10-06 22:24  π=3.1415926  阅读(373)  评论(0编辑  收藏  举报