Skip to content

Instantly share code, notes, and snippets.

@svnlto
Created July 11, 2015 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save svnlto/0f158b26844b910fd7cb to your computer and use it in GitHub Desktop.
Save svnlto/0f158b26844b910fd7cb to your computer and use it in GitHub Desktop.
packer file that creates a docker container based on alpine linux from an ansible playbook
{
"builders":[{
"type": "docker",
"image": "yikaus/alpine-bash",
"export_path": "image.tar"
}],
"provisioners":[
{
"type": "shell",
"inline": [
"apk update",
"apk add --update py-pip ansible",
"pip install --upgrade ansible"
]
},
{
"type": "ansible-local",
"playbook_file": "./playbooks/local.yml"
},
{
"type": "shell",
"inline": [
"apk del ansible",
"rm -rf /var/cache/apk/**/"
]
}
],
"post-processors": [
{
"type": "docker-import",
"repository": "svnlto/packer-ansible",
"tag": "latest"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment