Skip to content

shiwork/packer-vagrant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrantfile and Ansible playbook for packer

Packer development environment on vagrant

Requirement

Installation

$ git clone git@github.com:shiwork/packer-vagrant.git
$ cd packer-vagrant
$ vagrant up

Usage

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

TIPS

Use github/bitbucket access private key on vagrant

config.ssh.forward_agent

set up ssh-agent on host.

$ ssh-agent
$ ssh-add ~/.ssh/id_rsa # github/bitbucket access key
$ vagrant ssh

About

Vagrantfile and ansible paybook for Packer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published