#Linux from a Cloud Image
The easy path. Cloud images come pre-installed and pre-configured for cloud-init. You just boot, provision, capture.
vms:
- name: builder
source:
url: 'https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2'
resources:
cpu: 2
memory: '2Gi'
disks:
- name: rootdisk
size: '10Gi'
communicator:
sshUsername: debian
cloudInit:
userData: |
#cloud-config
ssh_authorized_keys: []
provisioners:
- name: update-and-install
type: shell
shell:
inline: |
set -euo pipefail
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nginx certbot
sudo systemctl enable nginx
- name: write-default-page
type: shell
shell:
inline: |
echo "<h1>Hello</h1>" | sudo tee /var/www/html/index.html
- name: cleanup
type: shell
shell:
inline: |
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
sudo journalctl --vacuum-time=1s
sudo cloud-init clean --logs
timeout: 30m