2
This commit is contained in:
parent
995aa9b627
commit
016d4d13a7
8
build.sh
8
build.sh
@ -1,8 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
# install ubuntu dependenices for image building
|
# install ubuntu dependenices for image building
|
||||||
apt update
|
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
|
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
|
chmod +x alpine-make-vm-image
|
||||||
@ -21,3 +23,7 @@ DISK_SIZE="20G"
|
|||||||
IMAGE_FORMAT="qcow2"
|
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}
|
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
2
seed/meta-data
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
instance-id: iid-local01
|
||||||
|
local-hostname: cloudimg
|
4
seed/user-data
Normal file
4
seed/user-data
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#cloud-config
|
||||||
|
password: passw0rd
|
||||||
|
chpasswd: { expire: False }
|
||||||
|
ssh_pwauth: True
|
Loading…
Reference in New Issue
Block a user