fix wget conditionnal for base images
This commit is contained in:
parent
29eadc7b92
commit
39ec48492f
@ -10,6 +10,7 @@ RUN yum install -y \
|
||||
libvirt-daemon-qemu \
|
||||
libvirt-client \
|
||||
selinux-policy selinux-policy-targeted \
|
||||
wget \
|
||||
augeas
|
||||
|
||||
COPY augconf /augconf
|
||||
|
@ -13,10 +13,14 @@ services:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
LIBVIRTD_DEFAULT_NETWORK: "true"
|
||||
LIBVIRTD_DEFAULT_POOL_PATH: "/var/lib/libvirt/images"
|
||||
LIBVIRTD_DEFAULT_POOL_PATH: "/var/lib/libvirt/pool/default"
|
||||
PRE_DOWNLOAD_IMAGES:
|
||||
"https://cdimage.debian.org/cdimage/openstack/current-10/debian-10-openstack-amd64.qcow2,\
|
||||
https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2"
|
||||
volumes:
|
||||
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
|
||||
- libvirt-images:/var/lib/libvirt/images
|
||||
- libvirt-images:/images
|
||||
- libvirt-pool:/var/lib/libvirt/pool
|
||||
- /:/host:Z
|
||||
volumes:
|
||||
libvirt-images:
|
||||
|
12
libvirtd.sh
12
libvirtd.sh
@ -87,6 +87,18 @@ EOX
|
||||
ln -s /etc/libvirt/storage/default.xml /etc/libvirt/storage/autostart/default.xml
|
||||
fi
|
||||
|
||||
# Download some image at startup
|
||||
if [[ -n "$PRE_DOWNLOAD_IMAGES" ]]; then
|
||||
# loop on each image and download it
|
||||
echo "$PRE_DOWNLOAD_IMAGES" | sed -n 1'p' | tr ',' '\n' | while read image; do
|
||||
|
||||
if [ ! -f /images/"$(basename $image)" ]; then
|
||||
echo "downloading $image ..."
|
||||
wget "$image" -O /images/"$(basename $image)" &
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo "cgroup_controllers = []" >> /etc/libvirt/qemu.conf
|
||||
echo "namespaces = []" >> /etc/libvirt/qemu.conf
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user