From fdf9dd508d10b426cd78915cbeb7a368ee95c87c Mon Sep 17 00:00:00 2001 From: Mauricio Lima Date: Wed, 3 Aug 2016 10:05:58 -0400 Subject: [PATCH] Customizations for Manila Change-Id: I3383f206b66d1af39273ec0564a53f1f7a592527 Partially-implements: blueprint third-party-plugin-support --- docker/manila/manila-api/Dockerfile.j2 | 12 +++++-- docker/manila/manila-base/Dockerfile.j2 | 34 ++++++++++++-------- docker/manila/manila-scheduler/Dockerfile.j2 | 12 +++++-- docker/manila/manila-share/Dockerfile.j2 | 12 +++++-- 4 files changed, 47 insertions(+), 23 deletions(-) diff --git a/docker/manila/manila-api/Dockerfile.j2 b/docker/manila/manila-api/Dockerfile.j2 index f6eee14863..813c8d6342 100644 --- a/docker/manila/manila-api/Dockerfile.j2 +++ b/docker/manila/manila-api/Dockerfile.j2 @@ -1,12 +1,16 @@ FROM {{ namespace }}/{{ image_prefix }}manila-base:{{ tag }} MAINTAINER {{ maintainer }} +{% import "macros.j2" as macros with context %} + {% if install_type == 'binary' %} {% if base_distro in ['ubuntu'] %} -RUN apt-get -y install --no-install-recommends \ - manila-api \ - && apt-get clean + {% set manila_api_packages = [ + 'manila-api' + ] %} + +RUN {{ macros.install_packages(manila_api_packages | customizable("packages")) }} {% endif%} {% endif%} @@ -14,6 +18,8 @@ RUN apt-get -y install --no-install-recommends \ COPY extend_start.sh /usr/local/bin/kolla_manila_extend_start RUN chmod 755 /usr/local/bin/kolla_manila_extend_start +{% block manila_api_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER manila diff --git a/docker/manila/manila-base/Dockerfile.j2 b/docker/manila/manila-base/Dockerfile.j2 index 2d6ee3c6ba..a162f62a29 100644 --- a/docker/manila/manila-base/Dockerfile.j2 +++ b/docker/manila/manila-base/Dockerfile.j2 @@ -1,37 +1,40 @@ FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }} MAINTAINER {{ maintainer }} +{% import "macros.j2" as macros with context %} + {% if install_type == 'binary' %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} -RUN yum -y install \ - openstack-manila \ - openvswitch \ - && yum clean all + {% set manila_base_packages = [ + 'openstack-manila', + 'openvswitch' + ] %} {% elif base_distro in ['ubuntu'] %} -RUN apt-get -y install --no-install-recommends \ - manila-common \ - openvswitch-switch \ - && apt-get clean + {% set manila_base_packages = [ + 'manila-common', + 'openvswitch-switch' + ] %} {% endif %} + +RUN {{ macros.install_packages(manila_base_packages | customizable("packages")) }} + {% elif install_type == 'source' %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} -RUN yum -y install \ - openvswitch \ - && yum clean all + {% set manila_base_packages = ['openvswitch'] %} {% elif base_distro in ['ubuntu', 'debian'] %} -RUN apt-get -y install --no-install-recommends \ - openvswitch-switch \ - && apt-get clean + {% set manila_base_packages = ['openvswitch-switch'] %} {% endif %} +RUN {{ macros.install_packages(manila_base_packages | customizable("packages")) }} + ADD manila-base-archive /manila-base-source RUN ln -s manila-base-source/* manila \ && useradd --user-group manila \ @@ -53,3 +56,6 @@ RUN touch /usr/local/bin/kolla_manila_extend_start \ && chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_manila_extend_start RUN usermod -a -G kolla manila + +{% block manila_base_footer %}{% endblock %} +{% block footer %}{% endblock %} diff --git a/docker/manila/manila-scheduler/Dockerfile.j2 b/docker/manila/manila-scheduler/Dockerfile.j2 index 0e99353a06..a9fb40d6b3 100644 --- a/docker/manila/manila-scheduler/Dockerfile.j2 +++ b/docker/manila/manila-scheduler/Dockerfile.j2 @@ -1,16 +1,22 @@ FROM {{ namespace }}/{{ image_prefix }}manila-base:{{ tag }} MAINTAINER {{ maintainer }} +{% import "macros.j2" as macros with context %} + {% if install_type == 'binary' %} {% if base_distro in ['ubuntu'] %} -RUN apt-get -y install --no-install-recommends \ - manila-scheduler \ - && apt-get clean + {% set manila_scheduler_packages = [ + 'manila-scheduler' + ] %} + +RUN {{ macros.install_packages(manila_scheduler_packages | customizable("packages")) }} {% endif%} {% endif%} +{% block manila_scheduler_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER manila diff --git a/docker/manila/manila-share/Dockerfile.j2 b/docker/manila/manila-share/Dockerfile.j2 index 769a50edcf..53732f4f73 100644 --- a/docker/manila/manila-share/Dockerfile.j2 +++ b/docker/manila/manila-share/Dockerfile.j2 @@ -1,16 +1,22 @@ FROM {{ namespace }}/{{ image_prefix }}manila-base:{{ tag }} MAINTAINER {{ maintainer }} +{% import "macros.j2" as macros with context %} + {% if install_type == 'binary' %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} -RUN yum -y install \ - openstack-manila-share \ - && yum clean all + {% set manila_share_packages = [ + 'openstack-manila-share' + ] %} + +RUN {{ macros.install_packages(manila_share_packages | customizable("packages")) }} {% endif %} {% endif %} +{% block manila_share_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER manila