From f06abbb557eb953d25454afa9e310ff8f2716313 Mon Sep 17 00:00:00 2001 From: Thales Elero Cervi Date: Thu, 1 Dec 2022 20:25:00 -0300 Subject: [PATCH] Port stx-libvirt base image to stx-debian This change enables building the stx-libvirt Docker image within the Debian build framework. It is now based on stx-debian and following the new convention for StarlingX images. Test Plan: PASS - Build libvirt debian package PASS - Build stx-libvirt image PASS - Manually upload built image to a system, use helm-override to change the libvirt container image and apply stx-openstack PASS - Ensure the libvirt Pod successfully starts and is running PASS - Ensure libvirt Pod Liveness and Readiness probes are healthy Story: 2010072 Task: 46974 Closes-Bug: 1998630 Depends-On: https://review.opendev.org/c/starlingx/tools/+/866411 Signed-off-by: Thales Elero Cervi Change-Id: I10112a0f1ab3a1f880ebc8b162c42b7b131d6aad --- debian_stable_docker_images.inc | 1 + virt/libvirt/debian/docker/Dockerfile | 54 +++++++++++++++++++ .../debian/stx-libvirt.stable_docker_image | 2 + 3 files changed, 57 insertions(+) create mode 100644 virt/libvirt/debian/docker/Dockerfile create mode 100644 virt/libvirt/debian/stx-libvirt.stable_docker_image diff --git a/debian_stable_docker_images.inc b/debian_stable_docker_images.inc index 49ab899a5..1d061b9dd 100644 --- a/debian_stable_docker_images.inc +++ b/debian_stable_docker_images.inc @@ -1 +1,2 @@ kubernetes/n3000 +virt/libvirt diff --git a/virt/libvirt/debian/docker/Dockerfile b/virt/libvirt/debian/docker/Dockerfile new file mode 100644 index 000000000..09efbfaef --- /dev/null +++ b/virt/libvirt/debian/docker/Dockerfile @@ -0,0 +1,54 @@ +# Expected build arguments: +# BASE: specify base layer +# REPO_OPTS: yum options to enable StarlingX repo +# +ARG BASE +FROM ${BASE} AS stx + +ENV DEBIAN_FRONTEND=noninteractive + +ARG PROJECT=nova +ARG UID=42424 +ARG GID=42424 + +RUN apt-get -y update \ + && apt-get -y install \ + ceph-common \ + dmidecode \ + iptables \ + iproute2 \ + cgroup-tools \ + libcgroup1 \ + libnss-libvirt \ + libvirt0 \ + libvirt-clients \ + libvirt-daemon \ + libvirt-daemon-config-network \ + libvirt-daemon-config-nwfilter \ + libvirt-daemon-driver-lxc \ + libvirt-daemon-driver-qemu \ + libvirt-daemon-driver-storage-gluster \ + libvirt-daemon-system \ + libvirt-daemon-system-systemd \ + libvirt-login-shell \ + pm-utils \ + qemu \ + qemu-block-extra \ + qemu-system-common \ + qemu-system-data \ + qemu-system-x86 \ + qemu-guest-agent \ + openvswitch-common \ + openvswitch-switch \ + openvswitch-switch-dpdk \ + python3-openvswitch \ + && apt-get -y clean \ + && rm -rf /var/lib/apt/lists/* + +RUN groupadd -g ${GID} ${PROJECT} ;\ + useradd -u ${UID} -g ${PROJECT} -M -d /var/lib/${PROJECT} -s /usr/sbin/nologin -c "${PROJECT} user" ${PROJECT} ;\ + mkdir -p /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} ;\ + chown ${PROJECT}:${PROJECT} /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} ;\ + usermod -a -G kvm ${PROJECT} ;\ + rm -rf /var/log/* /tmp/* /var/tmp/* + diff --git a/virt/libvirt/debian/stx-libvirt.stable_docker_image b/virt/libvirt/debian/stx-libvirt.stable_docker_image new file mode 100644 index 000000000..85c8fefae --- /dev/null +++ b/virt/libvirt/debian/stx-libvirt.stable_docker_image @@ -0,0 +1,2 @@ +BUILDER=docker +LABEL=stx-libvirt