diff --git a/docker/magnum/magnum-api/Dockerfile.j2 b/docker/magnum/magnum-api/Dockerfile.j2 index 16b8bf7656..8a4847c3a9 100644 --- a/docker/magnum/magnum-api/Dockerfile.j2 +++ b/docker/magnum/magnum-api/Dockerfile.j2 @@ -1,25 +1,21 @@ FROM {{ namespace }}/{{ image_prefix }}magnum-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-magnum-api \ - && yum clean all - + {% set magnum_api_packages = ['openstack-magnum-api'] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - magnum-api\ - && apt-get clean - + {% set magnum_api_packages = ['magnum-api'] %} {% endif %} +RUN {{ macros.install_packages(magnum_api_packages | customizable("packages")) }} {% endif %} COPY extend_start.sh /usr/local/bin/kolla_magnum_extend_start RUN chmod 755 /usr/local/bin/kolla_magnum_extend_start +{% block magnum_api_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER magnum diff --git a/docker/magnum/magnum-base/Dockerfile.j2 b/docker/magnum/magnum-base/Dockerfile.j2 index a6f83fab5e..1e7dcb8af9 100644 --- a/docker/magnum/magnum-base/Dockerfile.j2 +++ b/docker/magnum/magnum-base/Dockerfile.j2 @@ -1,21 +1,17 @@ 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'] %} + {% set magnum_base_packages = ['openstack-magnum-common'] %} -RUN curl -L https://trunk.rdoproject.org/centos7/current/delorean.repo -o /etc/yum.repos.d/delorean.repo \ - && yum -y install \ - openstack-magnum-common \ - && yum clean all - +RUN curl -L https://trunk.rdoproject.org/centos7/current/delorean.repo -o /etc/yum.repos.d/delorean.repo {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - magnum-common \ - && apt-get clean - + {% set magnum_base_packages = ['magnum-common'] %} {% endif %} +RUN {{ macros.install_packages(magnum_base_packages | customizable("packages")) }} + {% elif install_type == 'source' %} ADD magnum-base-archive /magnum-base-source diff --git a/docker/magnum/magnum-conductor/Dockerfile.j2 b/docker/magnum/magnum-conductor/Dockerfile.j2 index c71ac3fb79..84b15db18e 100644 --- a/docker/magnum/magnum-conductor/Dockerfile.j2 +++ b/docker/magnum/magnum-conductor/Dockerfile.j2 @@ -1,21 +1,18 @@ FROM {{ namespace }}/{{ image_prefix }}magnum-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-magnum-conductor \ - tar \ - && yum clean all + {% set magnum_conductor_packages = [ + 'openstack-magnum-conductor', + 'tar' + ] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - magnum-conductor\ - && apt-get clean - + {% set magnum_conductor_packages = ['magnum-conductor'] %} {% endif %} +RUN {{ macros.install_packages(magnum_conductor_packages | customizable("packages")) }} # Install kubectl binary (ugh) RUN cd /tmp \ @@ -26,6 +23,8 @@ RUN cd /tmp \ {% endif %} +{% block magnum_conductor_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER magnum