diff --git a/docker/aodh/aodh-api/Dockerfile.j2 b/docker/aodh/aodh-api/Dockerfile.j2 index 81fd8f363c..939cd3742d 100644 --- a/docker/aodh/aodh-api/Dockerfile.j2 +++ b/docker/aodh/aodh-api/Dockerfile.j2 @@ -1,25 +1,21 @@ FROM {{ namespace }}/{{ image_prefix }}aodh-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-aodh-api \ - && yum clean all - + {% set aodh_api_packages = ['openstack-aodh-api'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - aodh-api \ - && apt-get clean - + {% set aodh_api_packages = ['aodh-api'] %} {% endif %} +RUN {{ macros.install_packages(aodh_api_packages | customizable("packages")) }} {% endif %} -COPY extend_start.sh /usr/local/bin/kolla_extend_start -RUN chmod 755 /usr/local/bin/kolla_extend_start +COPY extend_start.sh /usr/local/bin/kolla_aodh_extend_start +RUN chmod 755 /usr/local/bin/kolla_aodh_extend_start +{% block aodh_api_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER aodh diff --git a/docker/aodh/aodh-base/Dockerfile.j2 b/docker/aodh/aodh-base/Dockerfile.j2 index 44951be5b5..9ab6002cf4 100644 --- a/docker/aodh/aodh-base/Dockerfile.j2 +++ b/docker/aodh/aodh-base/Dockerfile.j2 @@ -1,20 +1,16 @@ 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-aodh-common \ - && yum clean all - - {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - aodh-common \ - && apt-get clean - - {% endif %} +{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} + {% set aodh_base_packages = ['openstack-aodh-common'] %} +{% elif base_distro in ['ubuntu'] %} + {% set aodh_base_packages = ['aodh-common'] %} +{% endif %} +RUN {{ macros.install_packages(aodh_base_packages | customizable("packages")) }} {% elif install_type == 'source' %} @@ -29,3 +25,6 @@ RUN ln -s aodh-base-source/* aodh \ {% endif %} RUN usermod -a -G kolla aodh + +{% block aodh_base_footer %}{% endblock %} +{% block footer %}{% endblock %} diff --git a/docker/aodh/aodh-evaluator/Dockerfile.j2 b/docker/aodh/aodh-evaluator/Dockerfile.j2 index 18507a4c0c..c2c3596272 100644 --- a/docker/aodh/aodh-evaluator/Dockerfile.j2 +++ b/docker/aodh/aodh-evaluator/Dockerfile.j2 @@ -1,21 +1,19 @@ FROM {{ namespace }}/{{ image_prefix }}aodh-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-aodh-evaluator \ - && yum clean all - + {% set aodh_evaluator_packages = ['openstack-aodh-evaluator'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - aodh-evaluator \ - && apt-get clean - + {% set aodh_evaluator_packages = ['aodh-evaluator'] %} {% endif %} +RUN {{ macros.install_packages(aodh_evaluator_packages | customizable("packages")) }} + {% endif %} +{% block aodh_evaluator_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} diff --git a/docker/aodh/aodh-expirer/Dockerfile.j2 b/docker/aodh/aodh-expirer/Dockerfile.j2 index 03b0560726..8c7ef8433c 100644 --- a/docker/aodh/aodh-expirer/Dockerfile.j2 +++ b/docker/aodh/aodh-expirer/Dockerfile.j2 @@ -1,21 +1,19 @@ FROM {{ namespace }}/{{ image_prefix }}aodh-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-aodh-expirer \ - && yum clean all - + {% set aodh_expirer_packages = ['openstack-aodh-expirer'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - aodh-expirer \ - && apt-get clean - + {% set aodh_expirer_packages = ['aodh-expirer'] %} {% endif %} +RUN {{ macros.install_packages(aodh_expirer_packages | customizable("packages")) }} + {% endif %} +{% block aodh_expirer_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} diff --git a/docker/aodh/aodh-listener/Dockerfile.j2 b/docker/aodh/aodh-listener/Dockerfile.j2 index a329f0d818..b3a565c69b 100644 --- a/docker/aodh/aodh-listener/Dockerfile.j2 +++ b/docker/aodh/aodh-listener/Dockerfile.j2 @@ -1,21 +1,19 @@ FROM {{ namespace }}/{{ image_prefix }}aodh-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-aodh-listener \ - && yum clean all - + {% set aodh_listener_packages = ['openstack-aodh-listener'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - aodh-listener \ - && apt-get clean - + {% set aodh_listener_packages = ['aodh-listener'] %} {% endif %} +RUN {{ macros.install_packages(aodh_listener_packages | customizable("packages")) }} + {% endif %} +{% block aodh_listener_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} diff --git a/docker/aodh/aodh-notifier/Dockerfile.j2 b/docker/aodh/aodh-notifier/Dockerfile.j2 index 29d11cf98b..c70ea15996 100644 --- a/docker/aodh/aodh-notifier/Dockerfile.j2 +++ b/docker/aodh/aodh-notifier/Dockerfile.j2 @@ -1,21 +1,19 @@ FROM {{ namespace }}/{{ image_prefix }}aodh-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-aodh-notifier \ - && yum clean all - + {% set aodh_notifier_packages = ['openstack-aodh-notifier'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - aodh-notifier \ - && apt-get clean - + {% set aodh_notifier_packages = ['aodh-notifier'] %} {% endif %} +RUN {{ macros.install_packages(aodh_notifier_packages | customizable("packages")) }} + {% endif %} +{% block aodh_notifier_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }}