Add a little packer template for building an Ubuntu host with Docker already present
This commit is contained in:
parent
fd7ae0e889
commit
d79566b556
|
@ -0,0 +1,2 @@
|
|||
.*.json
|
||||
*.sw*
|
|
@ -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
|
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue