Add a little packer template for building an Ubuntu host with Docker already present

This commit is contained in:
R. Tyler Croy 2017-08-21 21:00:52 -07:00
parent fd7ae0e889
commit d79566b556
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
3 changed files with 62 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.*.json
*.sw*

16
Makefile Normal file
View File

@ -0,0 +1,16 @@
validate:
for t in $(shell find . -iname "*.packer.json" -type f); do \
./scripts/packer validate --var-file=.azure.json $$t; \
done;
all: validate
for t in $(shell find . -iname "*.packer.json" -type f); do \
./scripts/packer build --var-file=.azure.json $$t; \
done;
.PHONY: all validate clean

View File

@ -0,0 +1,44 @@
{
"builders" : [
{
"type": "azure-arm",
"subscription_id": "{{user `azure_subscription_id`}}",
"client_id": "{{user `azure_client_id`}}",
"client_secret": "{{user `azure_client_secret`}}",
"tenant_id" : "{{user `azure_tenant_id`}}",
"resource_group_name": "azureagents-for-codevalet",
"storage_account": "codevaletvhds",
"capture_container_name": "images",
"capture_name_prefix": "packer",
"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "16.04-LTS",
"location": "East US 2",
"vm_size": "Standard_A4"
}
],
"provisioners" : [
{
"type" : "shell",
"inline" : [
"curl -sSL https://get.docker.com | bash",
"sudo apt-get install -qy git make default-jdk"
]
},
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}
]
}