Packer 㧠Vagrant ã® Box ãä½ã
ãã³ãã¬ã¼ããèªåã§ä½ãã®ãã©ãã«ãé¢åã«æãã¦ãªããªãæãåºããã«ãã Packer ã§ããã調ã¹ã¦ã¿ããçµæ§ãã³ãã¬ã¼ããå ¬éãã¦ããã¦ããæ¹ãããããã§ãã
misheska/basebox-packer
https://github.com/misheska/basebox-packer
shiguredo/packer-templates
https://github.com/shiguredo/packer-templates
hnakamur/my-packer-template-files
https://github.com/hnakamur/my-packer-template-files
nickchappell/packer-templates
https://github.com/nickchappell/packer-templates
ã¨ãã訳ã§ä»æ´ãªãã試ãã¦ã¿ã¾ããã
ç°å¢ã¯ Windows7 64bit ã§ãã
ã¤ã³ã¹ãã¼ã«
Downloads - Packer
http://www.packer.io/downloads.html
ä¸è¨ãã¼ã¸å
ã® [Windows] ã®ã¨ããã® [amd64] ã®ãªã³ã¯ãã¯ãªãã¯ãã¦ãã¦ã³ãã¼ããã¾ãã
ãã¦ã³ãã¼ãããéã®ãã¼ã¸ã§ã³ 0.5.2 ã§ããã
ãã¦ã³ãã¼ããã 0.5.2_windows_amd64.zip ãé©å½ãªãã©ã«ãã«è§£åãããã©ã«ããç°å¢å¤æ° PATH ã«è¿½å ãã¾ãã
ã³ãã³ãããã³ãããã以ä¸ã®ããã«ãã¼ã¸ã§ã³ã確èªã§ããã°ã¤ã³ã¹ãã¼ã«ã¯å®äºã§ãã
>packer --version Packer v0.5.2
Box ã®ä½æ
ã¾ãã¯é©å½ãªãã©ã«ãã«ç§»åãã¦ããã³ãã¬ã¼ãã clone ãã¾ãã
ããã§ã¯ä»¥ä¸ã®ãã³ãã¬ã¼ãã使ç¨ããã¦é ãã¾ããã
misheska/basebox-packer
https://github.com/misheska/basebox-packer
>git clone git://github.com/misheska/basebox-packer.git
CentOS 6.5 ãå
¥ãã¦ã¿ã¾ãã
CentOS ç¨ã®ãã³ãã¬ã¼ãã®ãããã©ã«ãã¾ã§ç§»åãã¾ãã
>cd basebox-packer\template\centos\
é å¸ããã¦ãããã³ãã¬ã¼ãã§ã¯è¨èªè¨å®ããã¼ãã¼ããªã©ã US ã«ãªã£ã¦ããã®ã§ã以ä¸ã®ãã¡ã¤ã«ãå¤æ´ãã¾ãã
- basebox-packer\template\centos\http\ks.cfg
ä¸è¨ãã¡ã¤ã«ãã¨ãã£ã¿çã§éãã¦ã以ä¸ã®é¨åãå¤æ´ãã¾ããã
lang ja_JP.UTF-8 keyboard jp106 timezone Asia/Tokyo
ä½æãã Box ã®ã¡ã¢ãªããã£ã¹ã¯å®¹éãªã©ã¯ä»¥ä¸ã®ãã¡ã¤ã«ã§å¤æ´ã§ãã¾ãã
ä»åã¯ä»¥ä¸ã®ããã«å¤æ´ãã¾ããã
ã»ã»ã» "builders": [{ "vm_name": "centos65", "type": "vmware-iso", ã»ã»ã» "disk_size": 30420, "vmx_data": { "memsize": "1024", "numvcpus": "2", "cpuid.coresPerSocket": "1" } }, { "vm_name": "centos65", "type": "virtualbox-iso", ã»ã»ã» "disk_size": 30420, "vboxmanage": [ ["modifyvm", "{{.Name}}", "--memory", "1024"], ["modifyvm", "{{.Name}}", "--cpus", "2"] ] ã»ã»ã»
ãã VirtualBox ç¨ã® box ããä½æããªããã¨ãããããªå ´åã¯å¤æ´ããã®ã¯ã"type": "virtualbox-iso"ãå´ã®è©²å½ç®æã ã㧠OK ãªã¯ãã§ãã
æºåãåºæ¥ãã®ã§ Box ãä½æãã¾ãã
VirtualBox ç¨ã® box ã ãä½æããã°ããã®ã§ãã-only=virtualbox-isoããªãã·ã§ã³ä»ãã§ãã«ããã¾ãã
>packer build -only=virtualbox-iso centos65.json
ããã§ãã°ããå¾ ã¤ã¨ãbasebox-packer\virtualboxããã©ã«ãã®ä¸ã« Box ãã¡ã¤ã«ãä½æããã¾ãã
ã¡ãªã¿ã«ä¸è¨ã®ãmisheska/basebox-packerãã«ãã centos510.json ã®ãã³ãã¬ã¼ãã使ã£ãå ´åãæå
ã®ç°å¢ã§ã¯ build ä¸ã«ãUnknown command unsupported_hardwareãã¨ã©ã¼ã«ãªã£ã¦ãã¾ãã¾ããã
ãã®å ´åãks.cfg å
ã®ãunsupported_hardwareãã®è¡ãã³ã¡ã³ãã¢ã¦ããã¦ããå度å®è¡ãããä¸æãè¡ã£ãã®ã§ãåèã¾ã§ã«ã
å
¬éããã¦ãããã³ãã¬ã¼ãã使ãã¨ããªãç°¡åã« Box ãä½æã§ãã¦ããã§ããã
ããããã使ããã¦é ãããã¨æãã¾ãã