Skip to content

Instantly share code, notes, and snippets.

@dasgoll
Created June 3, 2017 12:16
Show Gist options
  • Save dasgoll/97ce8a4e595866e249460ffe4933c0ab to your computer and use it in GitHub Desktop.
Save dasgoll/97ce8a4e595866e249460ffe4933c0ab to your computer and use it in GitHub Desktop.
Packer Docker and Chef
{
"builders": [{
"type": "docker",
"image": "centos"
}],
"provisioners" : [
{
"type": "shell",
"inline": ["yum update -y"]
},
{
"type": "chef-client",
"staging_directory": "/etc/chef",
"server_url": "https://yourchefserver.com",
"validation_client_name": "validator",
"validation_key_path": "/home/user/validator.pem",
"install_command": "curl -L https://www.opscode.com/chef/install.sh | sudo bash -s -- -v 12.6.0",
"chef_environment": "default",
"run_list": "role[yourrole]",
"node_name": "packer_and_chef"
}],
"post-processors" : [
[
{
"type": "docker-tag",
"repository": "yourrepo/example",
"tag": "0.1"
},
"docker-push"
]
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment