在Centos 6.6 docker容器中安装Chef服务器

时间:2015-03-06 02:04:11

标签: docker chef centos6

我使用最新版本的docker运行centos 6.5 minimal。我从centos 6.6图像创建了一个容器,运行正常。然后我将厨师服务器12安装到容器上,但是当我运行重新配置时,它出错了:

[2015-03-06T01:32:47+00:00] ERROR: Running exception handlers
Running handlers complete
[2015-03-06T01:32:47+00:00] ERROR: Exception handlers complete
[2015-03-06T01:32:47+00:00] FATAL: Stacktrace dumped to /opt/opscode/embedded/cookbooks/cache/chef-stacktrace.out
Chef Client failed. 13 resources updated in 89.75134466 seconds
[2015-03-06T01:32:49+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: execute[initctl status private-chef-runsvdir] (enterprise::runit_upstart line 34) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of initctl status private-chef-runsvdir ----
STDOUT:
STDERR: initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
---- End output of initctl status private-chef-runsvdir ----
Ran initctl status private-chef-runsvdir returned 1

Ubuntu似乎已经解决了这个问题,但我想知道是否有Centos的解决方法,因为我确实看到了一个可以在docker库中提取的厨师服务器映像,所以我知道将它安装在容器上是可能的但我也无法为我工作。

2 个答案:

答案 0 :(得分:0)

您应该使用以下命令启动容器:/sbin/init。由于Chef服务器以守护进程启动,因此PID 1进程必须为/sbin/init

答案 1 :(得分:0)

  1. 备份现有的/ sbin / initctl sudo mv /sbin/initctl /sbin/initctl.distrib
  2. 从/ bin / true sudo ln -s /bin/true /sbin/initctl为/ sbin / initctl创建符号链接

这应该可以解决问题

相关问题