mirror of
https://gitlab.com/monolithify/base-image-build.git
synced 2024-11-22 20:11:22 +00:00
30 lines
953 B
Bash
30 lines
953 B
Bash
|
#!/bin/bash
|
||
|
set -e
|
||
|
|
||
|
source $utilsLocation/initSSHclient.sh
|
||
|
|
||
|
customDiskPath=$1
|
||
|
|
||
|
$scriptLocation/downloadGenericCloudDisk.sh
|
||
|
|
||
|
imagePath=$BASE_DISK_FILEPATH
|
||
|
|
||
|
echo "--- COPYING BASE IMAGE ---"
|
||
|
cp $imagePath $OUTPUT_FILE_PATH
|
||
|
imagePath=$OUTPUT_FILE_PATH
|
||
|
|
||
|
echo "--- Using image: $imagePath ---"
|
||
|
|
||
|
echo "--- Virtal disk resizing ---"
|
||
|
tempDiskName="${imagePath}a"
|
||
|
qemu-img create -f qcow2 $tempDiskName 50G
|
||
|
virt-resize --expand /dev/vda4 $imagePath $tempDiskName
|
||
|
rm $imagePath
|
||
|
mv $tempDiskName $imagePath
|
||
|
echo "--- Finished virtual disk resizing ---"
|
||
|
|
||
|
echo "--- Setting up Rocky Cloud image for ssh access and docker/buildah/podman ---"
|
||
|
echo "--- Creating rocky user; addng it to the wheel gorup; installing docker/buildah/podman; adding SSH access key to the rocky user ---"
|
||
|
virt-customize -a $imagePath --commands-from-file $scriptLocation/customizeBuilder.sh
|
||
|
echo "--- Finished setting up Rocky Rocky Cloud image for ssh access and docker/buildah/podman ---"
|