docker Failed to get D-Bus connection 报错 docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash
docker Failed to get D-Bus connection 报错
在centos7的容器里面出现了一个BUG,就是serveice启动服务的时候出现报错,不能用service启动服务。
[root@e13c3d3802d0 /]# service httpd start
Redirecting to /bin/systemctl start httpd.service
Failed to get D-Bus connection: Operation not permitted
首先恭喜你使用centos7镜像,然后就是不幸告诉你这个问题是个BUG 将在centos7.2解决。
Currently, systemd in CentOS 7 has been removed and replaced with a fakesystemd package for dependency resolution. This is due to systemd requiring the CAP_SYS_ADMIN capability, as well as being able to read the host's cgroups. If you wish to replace the fakesystemd package and use systemd normally, please follow the steps below.
我查了好多地方都说是个BUG不能解决
有的说创建的时候加上 --privileged选项
我试了这些然而并没有任何的卵用
最后实在是没办法就 rpm -ql 软件包 查看安装的时候有哪些命令在PATH下,用这些命令去启动,这个是一种解决的方法
例如apache的启动就是用命令 httpd
这几天研究了个解决的办法比较靠谱,亲身实测好使:
systemctl start http.service
Failed to get D-Bus connection: No connection to service manager.
这个的原因是因为dbus-daemon没能启动。其实systemctl并不是不可以使用。将你的CMD或者entrypoint设置为/usr/sbin/init即可。会自动将dbus等服务启动起来。
然后就可以使用systemctl了。命令如下:
docker run --privileged -ti -e "container=docker" -v /sys/fs/cgroup:/sys/fs/cgroup centos /usr/sbin/init
Set environment variables (-e, --env, --env-file)
$ docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash
Use the -e, --env, and --env-file flags to set simple (non-array) environment variables in the container you’re running, or overwrite variables that are defined in the Dockerfile of the image you’re running.
You can define the variable and its value when running the container:
$ docker run --env VAR1=value1 --env VAR2=value2 ubuntu env | grep VAR
VAR1=value1
VAR2=value2
docker Failed to get D-Bus connection 报错 docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash的更多相关文章
- Docker - 解决同步容器与主机时间报错:Error response from daemon: Error processing tar file(exit status 1): invalid symlink "/usr/share/zoneinfo/UTC" -> "../usr/share/zoneinfo/Asia/Shanghai"
问题背景 这里讲解了如何同步容器和主机的时间:https://www.cnblogs.com/poloyy/p/13967532.html 其中使用方法二 docker cp /etc/localti ...
- wince6.0 编译报错:"error C2220: warning treated as error - no 'object' file generated"的解决办法
内容提要:wince6.0编译报错:"error C2220: warning treated as error - no 'object' file generated" 原因是 ...
- mysql启动报错 mysql InnoDB: Error: could not open single-table tablespace file
mysql启动不成功,报错 mysql InnoDB: Error: could not open single-table tablespace file innodb_force_recovery ...
- nagios监控客户端报错/usr/bin/perl^M: bad interpreter: No such file or directory
nagios服务端监控客户端内存时发现监控不上 在客户端直接执行脚本,报错如下: # /usr/local/nagios/libexec/check_memory.pl -w 6% -c 3% -ba ...
- mysql报错“Starting MySQL...The server quit without updating PID file”处理
http://blog.csdn.net/lzq123_1/article/details/51354179 注意:要将/usr/bin/mysql_install_db替换成 /usr/bin/my ...
- salt '*' state.highstate 报错找不到文件,环境如下No Top file or master_tops data matches found.
salt '*' state.highstate 报错找不到文件,环境如下No Top file or master_tops data matches found. file_roots: b ...
- 页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久总算解决了
页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久 啥短标记,打开,都试了 最简单的办法 是重新建立一个文件, ...
- 报错:ERROR! The server quit without updating PID file (/usr/local/var/mysql/chenyuntekiMacBook-Air.local.pid).
在Mac上通过brew install mysql 安装了完mysql 执行mysql.server start 报错:ERROR! The server quit without updating ...
- 解决apscheduler报错:Run time of job …… next run at: ……)” was missed by
在Django中使用apscheduler django_apscheduler 实现定时任务, 来完成数据拉取. 一段时间后发现数据量对不上,遂查日志 发现报错如下: Run time of job ...
随机推荐
- Apache多站点配置教程
看见这个版关于网络程序方面的文章还比较少,下面来一发~实践证明,本教程适用于Apache 2.2.22,其他版本相差应该不大 我的博客:http://wislab.net/,希望跟大家多多交流噢 Ap ...
- UISearchBar cancel 按钮设置文本
主要是在 UISearchDisplayDelegate中更改: - (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayCont ...
- GMM高斯混合模型 学习(2)
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaHpxMjAwODExMjExMDc=/font/5a6L5L2T/fontsize/400/fill/I0 ...
- 全栈project师体能备战--知识面(10--20)
WCF Windows Communication Foundation(WCF)是由微软开发的一系列支持数据通信的应用程序框架,能够翻译为Windows 通讯开发平台. 对于 WCF 的client ...
- HttpClient 解说 (1) 基础
前言 超文本传输协议(HTTP)或许是当今互联网上使用的最重要的协议了. Web服务,有网络功能的设备和网络计算的发展,都持续扩展了HTTP协议的角色,超越了用户使用的Web浏览器范畴.同一时候,也添 ...
- MSSQL查找前一天,前一月,前一年的数据,对比当前时间记录查找超过一年,一月,一天的数据
,') ,GETDATE()) ,') ,GETDATE()) ,') ,GETDATE()) ,GETDATE())) ,GETDATE())) ,GETDATE()))
- iOS 烟花撒花效果,图层渐变,图层倒影特效。CAEmitterLayer粒子发射器
iOS 烟花撒花效果,图层渐变,图层倒影特效.CAEmitterLayer粒子发射器 上一节我写了一个关于视图图层的相关类,有关CALayer这个类的使用和一些使用方法,详细看这里,就是我们在处理视图 ...
- Sphinx高亮显示关键字
选取程序中使用的一部分代码: public function buildExcerptRows($ids) { $options = array( 'before_match' => '< ...
- C#:XML操作(简单)
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.X ...
- 字符编解码的故事(ASCII,GBK,Unicode,Utf-8区别)
很久很久以前,有一群人,他们决定用8个可以开合的晶体管来组合成不同的状态,以表示世界上的万物.他们认为8个开关状态作为原子单位很好,于是他们把这称为"字节". 再后来,他们又做了一 ...