diff --git a/docker/trove/trove-api/Dockerfile.j2 b/docker/trove/trove-api/Dockerfile.j2 index 05193afa8a..ed68f053ab 100644 --- a/docker/trove/trove-api/Dockerfile.j2 +++ b/docker/trove/trove-api/Dockerfile.j2 @@ -1,25 +1,23 @@ FROM {{ namespace }}/{{ image_prefix }}trove-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-trove-api \ - && yum clean all - + {% set trove_api_packages = ['openstack-trove-api'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - trove-api \ - && apt-get clean - + {% set trove_api_packages = ['trove-api'] %} {% endif %} + +RUN {{ macros.install_packages(trove_api_packages | customizable("packages")) }} + {% endif %} COPY extend_start.sh /usr/local/bin/kolla_extend_start RUN chmod 755 /usr/local/bin/kolla_extend_start +{% block trove_api_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER trove diff --git a/docker/trove/trove-base/Dockerfile.j2 b/docker/trove/trove-base/Dockerfile.j2 index 8edc655ac8..40a427f9bc 100644 --- a/docker/trove/trove-base/Dockerfile.j2 +++ b/docker/trove/trove-base/Dockerfile.j2 @@ -1,21 +1,18 @@ 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-trove-common \ - && yum clean all - + {% set trove_base_packages = ['openstack-trove-common'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - trove-common \ - && apt-get clean - + {% set trove_base_packages = ['trove-common'] %} {% endif %} +RUN {{ macros.install_packages(trove_base_packages | customizable("packages")) }} + {% elif install_type == 'source' %} ADD trove-base-archive /trove-base-source @@ -29,3 +26,6 @@ RUN ln -s trove-base-source/* trove \ {% endif %} RUN usermod -a -G kolla trove + +{% block trove_base_footer %}{% endblock %} +{% block footer %}{% endblock %} diff --git a/docker/trove/trove-conductor/Dockerfile.j2 b/docker/trove/trove-conductor/Dockerfile.j2 index fd734f7162..d1e5832803 100644 --- a/docker/trove/trove-conductor/Dockerfile.j2 +++ b/docker/trove/trove-conductor/Dockerfile.j2 @@ -1,22 +1,21 @@ FROM {{ namespace }}/{{ image_prefix }}trove-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-trove-conductor \ - && yum clean all - + {% set trove_conductor_packages = ['openstack-trove-conductor'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - trove-conductor \ - && apt-get clean - + {% set trove_conductor_packages = ['trove-conductor'] %} {% endif %} + +RUN {{ macros.install_packages(trove_conductor_packages | customizable("packages")) }} + {% endif %} +{% block trove_conductor_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER trove diff --git a/docker/trove/trove-guestagent/Dockerfile.j2 b/docker/trove/trove-guestagent/Dockerfile.j2 index b3ad099163..aff1af1fd0 100644 --- a/docker/trove/trove-guestagent/Dockerfile.j2 +++ b/docker/trove/trove-guestagent/Dockerfile.j2 @@ -1,22 +1,21 @@ FROM {{ namespace }}/{{ image_prefix }}trove-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-trove-guestagent \ - && yum clean all - + {% set trove_guestagent_packages = ['openstack-trove-guestagent'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - trove-guestagent \ - && apt-get clean - + {% set trove_guestagent_packages = ['trove-guestagent'] %} {% endif %} + +RUN {{ macros.install_packages(trove_guestagent_packages | customizable("packages")) }} + {% endif %} +{% block trove_guestagent_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER trove diff --git a/docker/trove/trove-taskmanager/Dockerfile.j2 b/docker/trove/trove-taskmanager/Dockerfile.j2 index 68667196c0..1eb7bb7859 100644 --- a/docker/trove/trove-taskmanager/Dockerfile.j2 +++ b/docker/trove/trove-taskmanager/Dockerfile.j2 @@ -1,22 +1,21 @@ FROM {{ namespace }}/{{ image_prefix }}trove-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-trove-taskmanager \ - && yum clean all - + {% set trove_taskmanager_packages = ['openstack-trove-taskmanager'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - trove-taskmanager \ - && apt-get clean - + {% set trove_taskmanager_packages = ['trove-taskmanager'] %} {% endif %} + +RUN {{ macros.install_packages(trove_taskmanager_packages | customizable("packages")) }} + {% endif %} +{% block trove_taskmanager_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER trove