Last active
August 29, 2015 14:11
-
-
Save tkuchiki/33b2068199f56c883f30 to your computer and use it in GitHub Desktop.
Docker provisioning for chef
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chef_root File.dirname(__FILE__) | |
log_level :info | |
log_location STDOUT | |
cookbook_path File.expand_path('cookbooks', chef_root) | |
file_cache_path '/var/chef/cache' | |
local_mode true | |
file_backup_path '/var/chef/backup' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remote_file "#{Chef::Config[:file_cache_path]}/nginx.rpm" do | |
source "http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm" | |
end | |
package "install nginx-release" do | |
source "#{Chef::Config[:file_cache_path]}/nginx.rpm" | |
end | |
package "nginx" | |
file "#{Chef::Config[:file_cache_path]}/nginx.rpm" do | |
action :delete | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:centos6 | |
EXPOSE 80 | |
ADD cookbooks /root/chef/cookbooks/ | |
ADD nodes /root/chef/nodes/ | |
ADD roles /root/chef/roles/ | |
ADD client.rb /root/chef/client.rb | |
RUN curl -L https://www.opscode.com/chef/install.sh | bash | |
RUN cd /root/chef && chef-client -c client.rb -j nodes/node.json | |
CMD ["/usr/sbin/nginx", "-g", "daemon off;"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"run_list":"recipe[nginx]"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment