【发布时间】:2016-10-03 20:51:29
【问题描述】:
我在手动使用 docker 方面做得很好。我想使用厨师实现docker。作为厨师的初学者,我编写了一个示例 docker-file,它将在 centos:7 上安装 httpd 服务。
我的 docker 文件位于 Cookbook>docker>default>Dockerfile
在我的食谱中,我编写了一个命令来在 chef-client 上执行 Dockerfile。当我在客户端上运行(命令chef-client -r recipe[docker::testing])时出现错误。
我有两个问题
- 我是否遵循流程,例如放置 docker 文件和编写配方。
- recipe 对 dockerfile 的实际作用
食谱:我的食谱位于 Cookbook>recipes>testing.rb
cookbook_file '/etc/Dockerfile' do
source 'Dockerfile'
end
execute 'Dockerfile' do
user "root"
command 'docker build -t sample:latest .'
action :run
end
Dockerfile:
FROM centos:6
MAINTAINER Kumar
RUN yum -y update
RUN YUM -y install httpd
错误:
Recipe Compile Error
================================================================================
Chef::Exceptions::RecipeNotFound
--------------------------------
could not find recipe default for cookbook docker
请帮忙。
【问题讨论】:
-
这个问题很难理解
标签: docker chef-infra