docker Failed to get D-Bus connection: Operation not permitted 解决办法

栏目: 编程工具 · 发布时间: 9年前

内容简介:docker Failed to get D-Bus connection: Operation not permitted 解决办法

系统用的是centos7.3,docker1.12,不管是在生成镜像时,或者是在容器内,如果用的 systemctl,service命令就会报Failed to get D-Bus connection: Operation not permitted。有人说centos7.2以后,就没有这个问题了,我用的7.3一样会有这样的问题。

1,后台运行的模式启动

$ docker run --name mynginx --privileged  -d -e "container=docker"  tankzhang/centos_nginx:v1  /usr/sbin/init

如果是交互模式,也就是-d换成-it,是进不去的,会提示你输入用户名和密码。

$ docker run --name mynginx --privileged -it -e "container=docker" tankzhang/centos_nginx:v1 /usr/sbin/init

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
CentOS Linux 7 (Core)
Kernel 3.10.0-123.el7.x86_64 on an x86_64

a1599b5ac6cc login:
Password:

2,docker exec进入到容器内

docker Failed to get D-Bus connection: Operation not permitted 解决办法

docker systemctl 启动

不要通过docker attach进入容器,因为根本进不去,并且会导致容器退出。


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。

Web Scalability for Startup Engineers

Web Scalability for Startup Engineers

Artur Ejsmont / McGraw / 2015-6-23 / USD 34.81

Design and build scalable web applications quickly This is an invaluable roadmap for meeting the rapid demand to deliver scalable applications in a startup environment. With a focus on core concept......一起来看看 《Web Scalability for Startup Engineers》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具