Packer development environment on vagrant
$ git clone git@github.com:shiwork/packer-vagrant.git
$ cd packer-vagrant
$ vagrant up
Login vagrant
$ vagrant ssh
Add packer json file
$ touch config.json
$ vim config.json
Example config.json
{
"builders": [
{
"type": "docker",
"image": "ubuntu:14.04",
"export_path": "ubuntu.tar"
}
],
"provisioners": [
{
"type": "shell",
"inline": ["echo test"]
}
],
"post-processors": [
[
{
"type": "docker-import",
"repository": "shiwork/ubuntu",
"tag": "0.1"
}
]
]
}
Build docker image
$ packer build config.json
set up ssh-agent on host.
$ ssh-agent
$ ssh-add ~/.ssh/id_rsa # github/bitbucket access key
$ vagrant ssh