因为centos7镜像的原因,默认是无法开启systemctl的,需要特权启动,并挂载cgroup,启动点设置为init,启动命令如下:
docker run -d -it –network=mynet –ip 172.18.0.8 –restart=always -h test –name test -v /sys/fs/cgroup:/sys/fs/cgroup:ro –privileged=true centos /usr/sbin/init
转载请注明:Findever » 解决 CentOS7 容器 Failed to get D-Bus connection: Operation not permitted