From 9c97dd5e66977b0cbff76c9451b0a69e32eaa54ae0d5acc0540e1d8762f1dda9 Mon Sep 17 00:00:00 2001 From: Vasily Ulyanov Date: Tue, 4 Jan 2022 13:06:05 +0000 Subject: [PATCH] Accepting request 943761 from home:vulyanov:branches:Virtualization - Make a "fixed appliance" for libguestfs - Explicitly install libguestfs{,-devel} and supermin OBS-URL: https://build.opensuse.org/request/show/943761 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-libguestfs-tools-container?expand=0&rev=3 --- Dockerfile | 11 +++++++++++ entrypoint.sh | 11 ++++++++--- virt-libguestfs-tools-container.changes | 6 ++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 944c447..b0d7715 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,11 +30,14 @@ RUN zypper -n install \ jfsutils \ kernel-kvmsmall \ ldmtool \ + libguestfs \ + libguestfs-devel \ mdadm \ parted \ qemu-tools \ qemu-x86 \ reiserfs \ + supermin \ xfsprogs \ xorriso \ zerofree && \ @@ -43,4 +46,12 @@ RUN zypper -n install \ COPY entrypoint.sh /entrypoint.sh RUN chmod +x entrypoint.sh +# Make a "fixed appliance" for libguestfs. +# Note: the resulting 'appliance/root' is a sparse file. Docker does not +# preserve sparseness hence a compressed tarball is created. +RUN LIBGUESTFS_BACKEND=direct \ + LIBGUESTFS_DEBUG=1 \ + libguestfs-make-fixed-appliance --xz && \ + rm -rf /var/tmp/.guestfs-* + ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/entrypoint.sh b/entrypoint.sh index be4434b..7b27def 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,12 @@ #!/bin/bash -xe -# KubeVirt will provide LIBGUESTFS_PATH via the pod environemnt. Unset it so the -# default search paths are used. -unset LIBGUESTFS_PATH +#KubeVirt provides LIBGUESTFS_PATH via the pod environemnt. +DIR=/usr/local/lib/guestfs +LIBGUESTFS_VERSION=$(rpm -q --queryformat=%{version} libguestfs) +LIBGUESTFS_APPLIANCE=/appliance-${LIBGUESTFS_VERSION}.tar.xz + +mkdir -p ${DIR} +tar -Jxf ${LIBGUESTFS_APPLIANCE} -C ${DIR} +touch ${DIR}/done /bin/bash diff --git a/virt-libguestfs-tools-container.changes b/virt-libguestfs-tools-container.changes index 8f7794b..1cd5004 100644 --- a/virt-libguestfs-tools-container.changes +++ b/virt-libguestfs-tools-container.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 3 12:49:43 UTC 2022 - Vasily Ulyanov + +- Make a "fixed appliance" for libguestfs +- Explicitly install libguestfs{,-devel} and supermin + ------------------------------------------------------------------- Tue Aug 3 07:33:03 UTC 2021 - Vasily Ulyanov