revert auto download qcow2 image from dockerfile, add image download from makefile on host
This commit is contained in:
parent
39ec48492f
commit
6e6f8cb647
10
Makefile
10
Makefile
@ -16,6 +16,16 @@ test:
|
||||
clean:
|
||||
docker-compose down
|
||||
|
||||
download = test ! -f "./images/$(shell basename $1)" && \
|
||||
wget "$1" -O "./images/$(shell basename $1)" || \
|
||||
echo "image $1 exist into /images/$(shell basename $1)"
|
||||
|
||||
download_debian:
|
||||
@$(call download,https://cdimage.debian.org/cdimage/openstack/current-10/debian-10-openstack-amd64.qcow2)
|
||||
|
||||
download_centos:
|
||||
@$(call download,https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2)
|
||||
|
||||
## management
|
||||
|
||||
status:
|
||||
|
@ -14,12 +14,8 @@ services:
|
||||
environment:
|
||||
LIBVIRTD_DEFAULT_NETWORK: "true"
|
||||
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:/images
|
||||
- libvirt-pool:/var/lib/libvirt/pool
|
||||
- /:/host:Z
|
||||
volumes:
|
||||
|
12
libvirtd.sh
12
libvirtd.sh
@ -87,18 +87,6 @@ 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