- Packer
- QEMU
- Docker
$ docker run -it -v `pwd`:/tmp/host --rm ubuntu:16.04
# apt update
# apt install -y vim cloud-utils
# cloud-localds /tmp/host/cloud.img /tmp/host/cloud.cfg
$ packer build template.json
$ docker run -it -v `pwd`:/tmp/host --rm ubuntu:16.04
# apt update
# apt install -y vim cloud-utils
# cloud-localds /tmp/host/cloud.img /tmp/host/cloud.cfg
$ packer build template.json
| #cloud-config | |
| password: ubuntu | |
| ssh_pwauth: true | |
| chpasswd: | |
| expire: false |
| { | |
| "builders": | |
| [ | |
| { | |
| "type": "qemu", | |
| "iso_url": "ubuntu-16.04-server-cloudimg-amd64-disk1.img", | |
| "iso_checksum": "3a4b7f6115ca074c4728e4628ca73160e6b7ef6995db3c382015545940568939", | |
| "iso_checksum_type": "sha256", | |
| "disk_image": true, | |
| "output_directory": "image", | |
| "disk_size": 5000, | |
| "format": "qcow2", | |
| "disk_compression": true, | |
| "headless": true, | |
| "accelerator": "none", | |
| "ssh_username": "ubuntu", | |
| "ssh_password": "ubuntu", | |
| "ssh_port": 22, | |
| "ssh_wait_timeout": "300s", | |
| "vm_name": "ubuntu", | |
| "use_default_display": true, | |
| "qemuargs": [ | |
| ["-m", "2048M"], | |
| ["-smp", "2"], | |
| ["-fda", "cloud.img"], | |
| ["-serial", "mon:stdio"] | |
| ] | |
| } | |
| ] | |
| } |
This is working for me, in case someone like me hit this
keypoint is