diff --git a/docker/ceilometer/ceilometer-api/Dockerfile.j2 b/docker/ceilometer/ceilometer-api/Dockerfile.j2 index 9d363498f1..e80f3f7cf9 100644 --- a/docker/ceilometer/ceilometer-api/Dockerfile.j2 +++ b/docker/ceilometer/ceilometer-api/Dockerfile.j2 @@ -1,25 +1,24 @@ FROM {{ namespace }}/{{ image_prefix }}ceilometer-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-ceilometer-api \ - && yum clean all - + {% set ceilometer_api_packages = ['openstack-ceilometer-api'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - ceilometer-api \ - && apt-get clean - + {% set ceilometer_api_packages = ['ceilometer-api'] %} {% endif %} + +RUN {{ macros.install_packages(ceilometer_api_packages | customizable("packages")) }} + {% endif %} COPY extend_start.sh /usr/local/bin/kolla_ceilometer_extend_start RUN chmod 755 /usr/local/bin/kolla_ceilometer_extend_start +{% block ceilometer_api_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER ceilometer diff --git a/docker/ceilometer/ceilometer-base/Dockerfile.j2 b/docker/ceilometer/ceilometer-base/Dockerfile.j2 index 717739b340..3e105906d8 100644 --- a/docker/ceilometer/ceilometer-base/Dockerfile.j2 +++ b/docker/ceilometer/ceilometer-base/Dockerfile.j2 @@ -1,24 +1,24 @@ 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-ceilometer-common \ - python-tooz \ - python-oslo-db \ - && yum clean all - + {% set ceilometer_base_packages = [ + 'openstack-ceilometer-common', + 'python-tooz', + 'python-oslo-db' + ] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - ceilometer-common \ - python-pymongo \ - && apt-get clean - + {% set ceilometer_base_packages = [ + 'ceilometer-common', + 'python-pymongo' + ] %} {% endif %} +RUN {{ macros.install_packages(ceilometer_base_packages | customizable("packages")) }} + {% elif install_type == 'source' %} ADD ceilometer-base-archive /ceilometer-base-source diff --git a/docker/ceilometer/ceilometer-central/Dockerfile.j2 b/docker/ceilometer/ceilometer-central/Dockerfile.j2 index e2c37afa77..26d4436971 100644 --- a/docker/ceilometer/ceilometer-central/Dockerfile.j2 +++ b/docker/ceilometer/ceilometer-central/Dockerfile.j2 @@ -1,22 +1,21 @@ FROM {{ namespace }}/{{ image_prefix }}ceilometer-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-ceilometer-central \ - && yum clean all - + {% set ceilometer_central_packages = ['openstack-ceilometer-central'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - ceilometer-agent-central \ - && apt-get clean - + {% set ceilometer_central_packages = ['ceilometer-agent-central'] %} {% endif %} + +RUN {{ macros.install_packages(ceilometer_central_packages | customizable("packages")) }} + {% endif %} +{% block ceilometer_central_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER ceilometer diff --git a/docker/ceilometer/ceilometer-collector/Dockerfile.j2 b/docker/ceilometer/ceilometer-collector/Dockerfile.j2 index d67b2b1806..e5f53f55e1 100644 --- a/docker/ceilometer/ceilometer-collector/Dockerfile.j2 +++ b/docker/ceilometer/ceilometer-collector/Dockerfile.j2 @@ -1,22 +1,21 @@ FROM {{ namespace }}/{{ image_prefix }}ceilometer-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-ceilometer-collector \ - && yum clean all - + {% set ceilometer_collector_packages = ['openstack-ceilometer-collector'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - ceilometer-collector \ - && apt-get clean - + {% set ceilometer_collector_packages = ['ceilometer-collector'] %} {% endif %} + +RUN {{ macros.install_packages(ceilometer_collector_packages | customizable("packages")) }} + {% endif %} +{% block ceilometer_collector_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER ceilometer diff --git a/docker/ceilometer/ceilometer-compute/Dockerfile.j2 b/docker/ceilometer/ceilometer-compute/Dockerfile.j2 index 96f0ff80bc..0bdd061452 100644 --- a/docker/ceilometer/ceilometer-compute/Dockerfile.j2 +++ b/docker/ceilometer/ceilometer-compute/Dockerfile.j2 @@ -1,22 +1,23 @@ FROM {{ namespace }}/{{ image_prefix }}ceilometer-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-ceilometer-compute \ - python-ceilometerclient \ - && yum clean all - + {% set ceilometer_compute_packages = [ + 'openstack-ceilometer-compute', + 'python-ceilometerclient' + ] %} {% elif base_distro in ['ubuntu', 'debian'] %} - -RUN apt-get -y install --no-install-recommends \ - ceilometer-agent-compute \ - python-ceilometerclient \ - && apt-get clean - + {% set ceilometer_compute_packages = [ + 'ceilometer-agent-compute', + 'python-ceilometerclient' + ] %} {% endif %} + +RUN {{ macros.install_packages(ceilometer_compute_packages | customizable("packages")) }} + {% elif install_type == 'source' %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} @@ -36,6 +37,8 @@ RUN /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements {% endif %} +{% block ceilometer_compute_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} # NOTE(huikang): non-root user does not work with libvirt.sock. diff --git a/docker/ceilometer/ceilometer-notification/Dockerfile.j2 b/docker/ceilometer/ceilometer-notification/Dockerfile.j2 index 8896dc562c..dabeeafa82 100644 --- a/docker/ceilometer/ceilometer-notification/Dockerfile.j2 +++ b/docker/ceilometer/ceilometer-notification/Dockerfile.j2 @@ -1,22 +1,21 @@ FROM {{ namespace }}/{{ image_prefix }}ceilometer-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-ceilometer-notification \ - && yum clean all - + {% set ceilometer_notification_packages = ['openstack-ceilometer-notification'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - ceilometer-agent-notification \ - && apt-get clean - + {% set ceilometer_notification_packages = ['ceilometer-agent-notification'] %} {% endif %} + +RUN {{ macros.install_packages(ceilometer_notification_packages | customizable("packages")) }} + {% endif %} +{% block ceilometer_notification_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER ceilometer