- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
以下是构建 centos:7 docker 镜像的更大镜像工厂模板的摘录。一切都按预期工作,但是我在正在运行的容器上收到 dbus 错误。任何帮助表示赞赏!
相同的代码在以下情况下有效:
vmware-iso
或 virtualbox
build 者。 centos:6
图片 chef-client -z
/sys/fs/cgroup:/sys/fs/cgroup:ro
卷 privileged
给 docker builder {
"builders": [{
"type": "docker",
"image": "centos:7",
"privileged": true,
"changes": [
"ONBUILD RUN {{ isotime }}"
],
"volumes": {
"/sys/fs/cgroup": "/sys/fs/cgroup:ro"
},
"export_path": "~/tmp/party_parrot.tar"
}],
"provisioners": [{
"cookbook_paths": [
"chef"
],
"prevent_sudo": true,
"run_list": [
"redhat_factory::default"
],
"chef_license": "accept",
"type": "chef-solo"
}]
}
Chef Recipe :
package 'tuned'
service 'tuned' do
action %i(start enable)
end
日志:
docker: output will be in this color.
==> docker: Creating a temporary directory for sharing data...
==> docker: Pulling Docker image: centos:7
docker: 7: Pulling from library/centos
docker: Digest: sha256:0f4ec88e21daf75124b8a9e5ca03c37a5e937e0e108a255d890492430789b60e
docker: Status: Image is up to date for centos:7
docker: docker.io/library/centos:7
==> docker: Starting docker container...
docker: Run command: docker run --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /Users/cr2p/.packer.d/tmp727655581:/packer-files -d -i -t --entrypoint=/bin/sh -- centos:7
docker: Container ID: f62d47e257a210442cce7f059a2be3dceb06fbce7673f16e04a52bdf5fa92891
==> docker: Using docker communicator to connect: 172.17.0.4
==> docker: Provisioning with chef-solo
docker: Installing Chef...
==> docker: % Total % Received % Xferd Average Speed Time Time Time Current
==> docker: Dload Upload Total Spent Left Speed
docker: el 7 x86_64
docker: Getting information for chef stable for el...
docker: downloading https://omnitruck.chef.io/stable/chef/metadata?v=&p=el&pv=7&m=x86_64
docker: to file /tmp/install.sh.17/metadata.txt
docker: trying curl...
==> docker: 100 23409 100 23409 0 0 34412 0 --:--:-- --:--:-- --:--:-- 34374
docker: sha1 dffee30e640f443cf1fbf8db17f319db09c1e21e
docker: sha256 b855820c1697dad395d3798f265e8c431b54a3bd29bbbd9ef87995cceaad3f17
docker: url https://packages.chef.io/files/stable/chef/17.2.29/el/7/chef-17.2.29-1.el7.x86_64.rpm
docker: version 17.2.29
docker: downloaded metadata file looks valid...
docker: downloading https://packages.chef.io/files/stable/chef/17.2.29/el/7/chef-17.2.29-1.el7.x86_64.rpm
docker: to file /tmp/install.sh.17/chef-17.2.29-1.el7.x86_64.rpm
docker: trying curl...
docker: Comparing checksum with sha256sum...
docker:
docker: WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
docker:
docker: You are installing a package without a version pin. If you are installing
docker: on production servers via an automated process this is DANGEROUS and you will
docker: be upgraded without warning on new releases, even to new major releases.
docker: Letting the version float is only appropriate in desktop, test, development or
docker: CI/CD environments.
docker:
docker: WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
docker:
docker: Installing chef
docker: installing with rpm...
==> docker: warning: /tmp/install.sh.17/chef-17.2.29-1.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
docker: Preparing... ########################################
docker: Updating / installing...
docker: chef-17.2.29-1.el7 ########################################
docker: Thank you for installing Chef Infra Client! For help getting started visit https://learn.chef.io
docker: Creating directory: /tmp/packer-chef-solo
docker: Creating directory: /tmp/packer-chef-solo/cookbooks-0
docker: Creating configuration file 'solo.rb'
docker: Creating JSON attribute file
docker: Executing Chef: chef-solo --no-color -c /tmp/packer-chef-solo/solo.rb -j /tmp/packer-chef-solo/node.json
docker: +---------------------------------------------+
docker: ✔ 2 product licenses accepted.
docker: +---------------------------------------------+
docker: Starting Chef Infra Client, version 17.2.29
docker: Patents: https://www.chef.io/patents
docker: [2021-06-17T15:02:07+00:00] WARN: Plugin Network: unable to detect ipaddress
docker: [2021-06-17T15:02:07+00:00] ERROR: shard_seed: Failed to get dmi property serial_number: is dmidecode installed?
docker: resolving cookbooks for run list: ["redhat_factory::default"]
docker: Synchronizing Cookbooks:
docker: - redhat_factory (1.0.0)
docker: Installing Cookbook Gems:
docker: Compiling Cookbooks...
docker: [2021-06-17T15:02:08+00:00] WARN: Resource yum_package built into Chef Infra Client is being overridden by the resource from a cookbook. Please upgrade your cookbook or remove the cookbook from your run_list.
docker: [2021-06-17T15:02:08+00:00] WARN: Provider yum_package built into Chef Infra Client is being overridden by the provider from a cookbook. Please upgrade your cookbook or remove the cookbook from your run_list.
docker: Converging 4 resources
docker: Recipe: redhat_factory::default
docker: * entitler[entitler] action nothing (skipped due to action :nothing)
docker: Recipe: redhat_factory::dummy
docker: * yum_package[tuned] action install
docker: - install version 0:2.11.0-11.el7_9.noarch of package tuned
docker: * service[tuned] action start
docker: * service[tuned]: No custom command for start specified and unable to locate the init.d script!
docker: ================================================================================
docker: Error executing action `start` on resource 'service[tuned]'
docker: ================================================================================
docker:
docker: Chef::Exceptions::Service
docker: -------------------------
docker: service[tuned]: No custom command for start specified and unable to locate the init.d script!
docker:
docker: Resource Declaration:
docker: ---------------------
docker: # In /tmp/packer-chef-solo/local-mode-cache/cache/cookbooks/redhat_factory/recipes/dummy.rb
docker:
docker: 3: service 'tuned' do
docker: 4: action %i(start enable)
docker: 5: end
docker:
docker: Compiled Resource:
docker: ------------------
docker: # Declared in /tmp/packer-chef-solo/local-mode-cache/cache/cookbooks/redhat_factory/recipes/dummy.rb:3:in `from_file'
docker:
docker: service("tuned") do
docker: action [:start, :enable]
docker: default_guard_interpreter :default
docker: declared_type :service
docker: cookbook_name "redhat_factory"
docker: recipe_name "dummy"
docker: service_name "tuned"
docker: supports {:restart=>nil, :reload=>nil, :status=>nil}
docker: end
docker:
docker: System Info:
docker: ------------
docker: chef_version=17.2.29
docker: platform=centos
docker: platform_version=7.9.2009
docker: ruby=ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]
docker: program_name=/usr/bin/chef-solo
docker: executable=/opt/chef/bin/chef-solo
docker:
docker:
docker: Running handlers:
docker: [2021-06-17T15:02:37+00:00] ERROR: Running exception handlers
docker: Running handlers complete
docker: [2021-06-17T15:02:37+00:00] ERROR: Exception handlers complete
docker: Chef Infra Client failed. 1 resources updated in 31 seconds
docker: [2021-06-17T15:02:37+00:00] FATAL: Stacktrace dumped to /tmp/packer-chef-solo/local-mode-cache/cache/chef-stacktrace.out
docker: [2021-06-17T15:02:37+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
docker: [2021-06-17T15:02:37+00:00] FATAL: Chef::Exceptions::Service: service[tuned] (redhat_factory::dummy line 3) had an error: Chef::Exceptions::Service: service[tuned]: No custom command for start specified and unable to locate the init.d script!
==> docker: Provisioning step had errors: Running the cleanup provisioner, if present...
==> docker: Killing the container: f62d47e257a210442cce7f059a2be3dceb06fbce7673f16e04a52bdf5fa92891
Build 'docker' errored after 48 seconds 995 milliseconds: Error executing Chef: Non-zero exit status: 1
==> Wait completed after 48 seconds 996 milliseconds
==> Some builds didn't complete successfully and had errors:
--> docker: Error executing Chef: Non-zero exit status: 1
==> Builds finished but no artifacts were created.
连接到正在运行的容器:
[root@a74a6b2cfa39 /]# systemctl --system status tuned
Failed to get D-Bus connection: Operation not permitted
[root@a74a6b2cfa39 /]# systemctl --system start tuned
Failed to get D-Bus connection: Operation not permitted
提前致谢!
最佳答案
我已经能够通过以下方式修改我的工作来解决这个问题:
run_command
特别是 entrypoint
属性 tmpfs
数组 {
"builders": [{
"type": "docker",
"image": "centos:7",
"pull": false,
"privileged": true,
"changes": [
"ONBUILD RUN {{ isotime }}"
],
"volumes": {
"/sys/fs/cgroup": "/sys/fs/cgroup:ro"
},
"export_path": "~/tmp/party_parrot.tar",
"tmpfs": [
"/tmp",
"/run"
],
"run_command": ["-d", "-i", "-t", "--entrypoint=/usr/sbin/init", "--", "{{.Image}}"]
}],
"provisioners": [{
"cookbook_paths": [
"chef"
],
"prevent_sudo": true,
"run_list": [
"redhat_factory::default"
],
"chef_license": "accept",
"type": "chef-solo",
"staging_directory": "/chef"
}]
}
关于docker - 通过 packer 构建 docker 容器并通过 chef-solo 进行配置在启动服务时失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68022350/
我的打包代码包含打包厨师 solo 供应商 { "type": "chef-solo", "cookbook_paths": ["chef/cookbooks/vendor"], "run
我理解 chef-client --daemonize 的目的,因为它是 Chef Server 可以连接和交互的服务。 但 chef-solo 是一个简单地使当前系统符合规范然后完成的命令。 那么
我正在尝试断言文本“abcd:移至历史记录”。所以我的代码是这样的: assertTrue("消息未显示",solo.searchText("abcd : 移至历史记录")); 虽然屏幕上显示消息“a
我创建了测试项目。在那里我创建了文件夹“robotium”并粘贴了 2 个 robotium jar 文件(robotium-solo-3.4.1-javadoc.jar 和 robtium-solo
在 Redhat/Fedora 上安装 Chef-solo 的正确方法是什么? 我尝试按照 opscode wiki 上的说明进行操作,但运行后 gem install chef --no-ri --
当我运行引导命令时,它会多次询问密码 Running Chef on 123.123.123.123... Installing Librarian cookbooks... Uploading th
我在我的 robotium 测试用例中使用 solo.searchText 函数。我将文本作为“$ testdata”传递以进行搜索。但即使屏幕上有文字,它也不会检测到文字。在使用 solo.sear
chef-solo 在安装 redis 时卡在最后,就好像 chef 在等待某个事件发生一样。这是我不得不用 ctrl+c 杀死它时的输出。 [2013-05-14T15:55:27+00:00] 错
我有一个测试类,但总是在 tearDown() 中得到一个 NullPointerException,有人知道为什么吗? public class LaunchManagerActivityTest
我不知道为什么我在互联网上找不到任何关于这个的信息。 我基本上想编写一个提示用户输入他们的 github 用户名/密码的 Recipe ,然后发布到 github API 以添加一个 ssh key
我已经为此苦苦挣扎了几个小时,但似乎没有取得任何进展。关于我应该从哪里开始调试的任何提示将不胜感激。 我正在尝试配置一个 Vagrant 机器并收到以下错误。 `==> default: Runnin
当使用 Vagrant 和厨师作为供应者时,我得到以下警告: [web] Chef 11.12.2 Omnibus package is already installed. [web] Runnin
我有一个似乎与此类似的问题:Berkshelf cookbooks are not being copied to the Vagrant directory , 但我相信它是不同的。 当我运行一个
我已经设置了一个基本的 Chef 基础架构,其中包含一个工作站、一个托管的 Chef 服务器和一个用作节点的 Ubuntu 服务器。我在我的工作场所使用此设置,因此需要代理才能连接互联网。我已经在 k
我正在使用 Chef-solo,以避免管理多个实例的麻烦(如果您认为这不是一个好主意,请纠正我) 我定义了一个“数据库”角色;我在目标节点上使用 Chef-solo 进行 cooking 。 现在,我
我正在使用 robotium 来测试我的应用程序。问题出在 solo.searchText 函数上。在我的应用程序中,我使用 expandale listview 来显示类别值。在使用 robotiu
我正在使用 robotium 来测试一个 android 项目。我有一个测试用例,我需要在其中测试一条由特殊字符组成的消息是否正确发布。所以我创建了一个由特殊字符组成的常量: public stati
我已经在 Redhat Linux 7.2 中安装了 ChefDK rpm 包。 chef-solo --version 命令提供了正确的版本(Chef:12.19.36)。 现在我尝试使用以下 ch
在我的 Activity 中,我执行 startActivityForResult(MediaStore.ACTION_IMAGE_CAPTURE), 然后我进入内置相机 Activity (在本例中
我从 Chef 社区下载了食谱“oc-java-master”,现在我尝试使用我安装在 Windows Server 2008 上的 Chef-solo 来运行它。 经过大量的谷歌搜索和 stacko
我是一名优秀的程序员,十分优秀!