From 8306864e2857d7292a3b1a0166f07b32ffa3ba4f Mon Sep 17 00:00:00 2001 From: Kirill Shileev Date: Tue, 9 Aug 2016 18:08:28 +0300 Subject: [PATCH] Customizations for Glance This patchset contains customization of Dockerfile of Glance containers Also removed mkdir /etc/ceph as obsolete. Change-Id: I3ba6e0d2dca1ecf72cf9f1b00e05e6955611c361 Partially-implements: blueprint third-party-plugin-support --- docker/glance/glance-api/Dockerfile.j2 | 2 + docker/glance/glance-base/Dockerfile.j2 | 56 +++++++++------------ docker/glance/glance-registry/Dockerfile.j2 | 2 + 3 files changed, 28 insertions(+), 32 deletions(-) diff --git a/docker/glance/glance-api/Dockerfile.j2 b/docker/glance/glance-api/Dockerfile.j2 index f195defdd9..c9de79c7ab 100644 --- a/docker/glance/glance-api/Dockerfile.j2 +++ b/docker/glance/glance-api/Dockerfile.j2 @@ -4,6 +4,8 @@ MAINTAINER {{ maintainer }} COPY extend_start.sh /usr/local/bin/kolla_glance_extend_start RUN chmod 755 /usr/local/bin/kolla_glance_extend_start +{% block glance_api_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER glance diff --git a/docker/glance/glance-base/Dockerfile.j2 b/docker/glance/glance-base/Dockerfile.j2 index a5b62717d6..7e7f9fb7d9 100644 --- a/docker/glance/glance-base/Dockerfile.j2 +++ b/docker/glance/glance-base/Dockerfile.j2 @@ -1,44 +1,32 @@ 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-glance \ - python-rbd \ - python-rados \ - && yum clean all \ - && mkdir -p /etc/ceph/ - + {% set glance_base_packages = [ + 'openstack-glance', + 'python-rbd', + 'python-rados' + ] %} {% elif base_distro in ['ubuntu'] %} - -RUN apt-get -y install --no-install-recommends \ - glance \ - python-rbd \ - python-rados \ - && apt-get clean \ - && mkdir -p /etc/ceph/ - + {% set glance_base_packages = [ + 'glance', + 'python-rbd', + 'python-rados' + ] %} {% endif %} + +RUN {{ macros.install_packages(glance_base_packages | customizable("packages")) }} + {% elif install_type == 'source' %} - {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} + {% set glance_base_packages = [ + 'python-rbd', + 'python-rados' + ] %} -RUN yum -y install \ - python-rbd \ - python-rados \ - && yum clean all \ - && mkdir -p /etc/ceph/ - - {% elif base_distro in ['ubuntu', 'debian'] %} - -RUN apt-get -y install --no-install-recommends \ - python-rbd \ - python-rados \ - && apt-get clean \ - && mkdir -p /etc/ceph/ - - {% endif %} +RUN {{ macros.install_packages(glance_base_packages | customizable("packages")) }} ADD glance-base-archive /glance-base-source RUN ln -s glance-base-source/* glance \ @@ -58,3 +46,7 @@ RUN usermod -a -G kolla glance \ && chmod 440 /etc/sudoers.d/kolla_glance_sudoers \ && touch /usr/local/bin/kolla_glance_extend_start \ && chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_glance_extend_start + +{% block glance_base_footer %}{% endblock %} +{% block footer %}{% endblock %} +{{ include_footer }} diff --git a/docker/glance/glance-registry/Dockerfile.j2 b/docker/glance/glance-registry/Dockerfile.j2 index 230deac7ab..d57831637b 100644 --- a/docker/glance/glance-registry/Dockerfile.j2 +++ b/docker/glance/glance-registry/Dockerfile.j2 @@ -1,6 +1,8 @@ FROM {{ namespace }}/{{ image_prefix }}glance-base:{{ tag }} MAINTAINER {{ maintainer }} +{% block glance_registry_footer %}{% endblock %} +{% block footer %}{% endblock %} {{ include_footer }} USER glance