From 547a7cf967a38b73a0c1adc752af51eded4a57b3 Mon Sep 17 00:00:00 2001 From: Benedikt Trefzer Date: Thu, 24 Mar 2016 14:52:24 +0100 Subject: [PATCH] Make nova-libvirt container build with debian - handle different xen-utils version in debian/ubuntu - add rm -f to ignore nonexistent file in debian - add variable for libvirt group since different in debian Partially-implements: blueprint build-debian Change-Id: I44c55981819294286d163b5391aefe967b6dd1d9 --- docker/nova/nova-libvirt/Dockerfile.j2 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docker/nova/nova-libvirt/Dockerfile.j2 b/docker/nova/nova-libvirt/Dockerfile.j2 index cc48d03636..ab87a6900c 100644 --- a/docker/nova/nova-libvirt/Dockerfile.j2 +++ b/docker/nova/nova-libvirt/Dockerfile.j2 @@ -1,6 +1,8 @@ FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }} MAINTAINER {{ maintainer }} +{% set libvirt_group = 'libvirtd' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} RUN yum -y install \ @@ -17,6 +19,17 @@ RUN yum -y install \ {% elif base_distro in ['ubuntu', 'debian'] %} +{% if base_distro == 'ubuntu' %} +{% set packages = + ' xen-utils-4.6' +%} +{% elif base_distro == 'debian' %} +{% set packages = + ' xen-utils-4.4 usermode' +%} +{% set libvirt_group = 'libvirt' %} +{% endif %} + RUN apt-get -y install --no-install-recommends \ ceph-common \ libvirt-bin \ @@ -25,11 +38,11 @@ RUN apt-get -y install --no-install-recommends \ qemu \ qemu-block-extra \ ebtables \ - xen-utils-4.6 \ + {{ packages }} \ && apt-get clean \ && mkdir -p /etc/ceph \ - && rm /etc/libvirt/qemu/networks/default.xml /etc/libvirt/qemu/networks/autostart/default.xml \ - && usermod -a -G libvirtd nova + && rm -f /etc/libvirt/qemu/networks/default.xml /etc/libvirt/qemu/networks/autostart/default.xml \ + && usermod -a -G {{ libvirt_group }} nova {% endif %}