boxes/ubuntu: create base container

This commit is contained in:
Fabio Rehm 2013-08-30 18:17:28 -03:00
parent 739e602794
commit 61e7cbce42

View file

@ -43,9 +43,9 @@ class BuildGenericBoxTask < ::Rake::TaskLib
create_base_container(template) do |rootfs| create_base_container(template) do |rootfs|
configure_vagrant_user(rootfs) configure_vagrant_user(rootfs)
install_cfg_engines(rootfs) install_cfg_engines(rootfs)
cleanup(rootfs)
prepare_package_contents(rootfs) prepare_package_contents(rootfs)
compress_box(rootfs) compress_box(rootfs)
cleanup(rootfs)
end end
end end
end end
@ -67,8 +67,11 @@ class BuildGenericBoxTask < ::Rake::TaskLib
end end
def create_base_container(template) def create_base_container(template)
puts "TODO: Create base container with #{template}" container_name = 'vagrant-base-box-tmp'
yield "/var/lib/lxc/vagrant-base-box-tmp/rootfs" sh "sudo lxc-create -n #{container_name} -t vagrant-base-box-template -- --arch #{@arch} --release #{@release}"
yield "/var/lib/lxc/#{container_name}/rootfs"
ensure
sh "sudo lxc-destroy -n #{container_name}"
end end
def configure_vagrant_user(rootfs) def configure_vagrant_user(rootfs)
@ -92,7 +95,7 @@ class BuildGenericBoxTask < ::Rake::TaskLib
end end
def import_template def import_template
template_name = "vagrant-base-box-tmp" template_name = "vagrant-base-box-template"
tmp_template_path = templates_path.join("lxc-#{template_name}") tmp_template_path = templates_path.join("lxc-#{template_name}")
src = "./boxes/templates/#{@distrib}" src = "./boxes/templates/#{@distrib}"