-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To reduce size and time od contianer quay.io/qm-images/kvm Build, qcow2 images is manipulated on host Signed-off-by: Yariv Rachmani <[email protected]>
- Loading branch information
Showing
3 changed files
with
28 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/bash | ||
|
||
# Install required repos | ||
dnf install guestfs-tools \ | ||
curl \ | ||
perl -y | ||
|
||
# Download fedora cloud image | ||
curl -Lo ./Fedora-Cloud-Base-Generic.qcow2 https://download.fedoraproject.org/pub/fedora/linux/releases/41/Cloud/"$(arch)"/images/Fedora-Cloud-Base-Generic-41-1.4."$(arch)".qcow2 | ||
|
||
# Customize user:pass | ||
export LIBGUESTFS_BACKEND=direct && \ | ||
virt-customize -a ./Fedora-Cloud-Base-Generic.qcow2 \ | ||
--edit '/etc/ssh/sshd_config: s/#PasswordAuthentication.*/PasswordAuthentication yes/' \ | ||
--uninstall cloud-init \ | ||
--firstboot-command "useradd -m -s /bin/bash -G wheel fedora" \ | ||
--firstboot-command "echo 'fedora:fedora' | chpasswd" | ||
|
||
# Container build | ||
podman build -t quay.io/qm-images/kvm:latest -f ContainerFile | ||
|