This commit is contained in:
Eliezer Croitoru 2023-07-02 07:55:09 +00:00
parent 995aa9b627
commit 016d4d13a7
3 changed files with 13 additions and 1 deletions

View File

@ -1,8 +1,10 @@
#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
# install ubuntu dependenices for image building
apt update
apt install -y libvirt-daemon qemu-utils qemu wget
apt install -y libvirt-daemon qemu-utils qemu wget genisoimage
wget https://raw.githubusercontent.com/alpinelinux/alpine-make-vm-image/master/alpine-make-vm-image -O alpine-make-vm-image
chmod +x alpine-make-vm-image
@ -21,3 +23,7 @@ DISK_SIZE="20G"
IMAGE_FORMAT="qcow2"
bash alpine-make-vm-image -b ${ALPINE_BRANCH} -p "$( cat ${PACKAGES_FILE} | xargs) " -s ${DISK_SIZE} -f ${IMAGE_FORMAT} ${IMAGES_FILENAME} --script-chroot ${INIT_SCRIPT}
cd seed
mkisofs -output ../alpine-cloud-init-data.iso -volid cidata -joliet -rock user-data meta-data
cd -

2
seed/meta-data Normal file
View File

@ -0,0 +1,2 @@
instance-id: iid-local01
local-hostname: cloudimg

4
seed/user-data Normal file
View File

@ -0,0 +1,4 @@
#cloud-config
password: passw0rd
chpasswd: { expire: False }
ssh_pwauth: True