Customizations for Designate

This patchset contains customization of Dockerfile of designate
containers

Change-Id: I846437df7c3c417846f1c771883e5eb266b78a37
Partially-implements: blueprint third-party-plugin-support
Signed-off-by: Eduardo Gonzalez <dabarren@gmail.com>
This commit is contained in:
Eduardo Gonzalez 2016-08-02 19:23:38 +02:00
parent e4259f805b
commit d2215eab04
8 changed files with 83 additions and 89 deletions

View File

@ -1,22 +1,18 @@
FROM {{ namespace }}/{{ image_prefix }}designate-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}designate-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %} {% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
{% set designate_api_packages = ['openstack-designate-api'] %}
RUN yum -y install \
openstack-designate-api \
&& yum clean all
{% elif base_distro in ['ubuntu'] %} {% elif base_distro in ['ubuntu'] %}
{% set designate_api_packages = ['designate-api'] %}
RUN apt-get -y install --no-install-recommends \
designate-api \
&& apt-get clean
{% endif %} {% endif %}
RUN {{ macros.install_packages(designate_api_packages | customizable("packages")) }}
{% endif %} {% endif %}
{% block designate_api_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }} {{ include_footer }}
USER designate USER designate

View File

@ -1,24 +1,25 @@
FROM {{ namespace }}/{{ image_prefix }}designate-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}designate-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %} {% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
{% set designate_backend_bind9_packages = ['bind'] %}
RUN yum -y install \ RUN {{ macros.install_packages(designate_backend_bind9_packages | customizable("packages")) }}
bind \ RUN mkdir -p /var/lib/kolla/ \
&& yum clean all \
&& mkdir -p /var/lib/kolla/ \
&& cp -pr /var/named /var/lib/kolla/var-named && cp -pr /var/named /var/lib/kolla/var-named
{% elif base_distro in ['ubuntu'] %} {% elif base_distro in ['ubuntu'] %}
{% set designate_backend_bind9_packages = ['bind9'] %}
RUN apt-get -y install --no-install-recommends \ RUN {{ macros.install_packages(designate_backend_bind9_packages | customizable("packages")) }}
bind9 \
&& apt-get clean
{% endif %} {% endif %}
{% endif %} {% endif %}
{% block designate_backend_bind9_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }} {{ include_footer }}
USER designate USER designate

View File

@ -1,5 +1,6 @@
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %} {% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
@ -8,24 +9,27 @@ MAINTAINER {{ maintainer }}
# is needed in all services. This is probably a packaging bug. We do # is needed in all services. This is probably a packaging bug. We do
# need the complete policy file because of some of the containers' # need the complete policy file because of some of the containers'
# requiring it. Remove the package when the file is moved though. # requiring it. Remove the package when the file is moved though.
RUN yum -y install \ {% set designate_base_packages = [
openstack-designate-api \ 'openstack-designate-api',
openstack-designate-common \ 'openstack-designate-common',
python-tooz \ 'python-tooz',
python2-oslo-reports \ 'python2-oslo-reports',
python2-suds \ 'python2-suds'
&& yum clean all \ ] %}
&& cp /etc/designate/policy.json /tmp/ \
RUN {{ macros.install_packages(designate_base_packages | customizable("packages")) }}
RUN cp /etc/designate/policy.json /tmp/ \
&& rpm -e openstack-designate-api \ && rpm -e openstack-designate-api \
&& mv /tmp/policy.json /etc/designate/ \ && mv /tmp/policy.json /etc/designate/ \
&& chown designate: /etc/designate/policy.json && chown designate: /etc/designate/policy.json
{% elif base_distro in ['ubuntu'] %} {% elif base_distro in ['ubuntu'] %}
{% set designate_base_packages = [
'designate-common',
'python-tooz'
] %}
RUN apt-get -y install --no-install-recommends \ RUN {{ macros.install_packages(designate_base_packages | customizable("packages")) }}
designate-common \
python-tooz \
&& apt-get clean
{% endif %} {% endif %}
{% elif install_type == 'source' %} {% elif install_type == 'source' %}
@ -39,12 +43,14 @@ RUN ln -s designate-base-source/* designate \
&& mv /etc/designate/rootwrap.conf.sample /etc/designate/rootwrap.conf \ && mv /etc/designate/rootwrap.conf.sample /etc/designate/rootwrap.conf \
&& chown -R designate: /etc/designate /var/log/designate /home/designate \ && chown -R designate: /etc/designate /var/log/designate /home/designate \
&& sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/designate/rootwrap.conf && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/designate/rootwrap.conf
{% endif %} {% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN touch /usr/local/bin/kolla_designate_extend_start \ RUN touch /usr/local/bin/kolla_designate_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_designate_extend_start && chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_designate_extend_start
{% block designate_base_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
RUN usermod -a -G kolla designate RUN usermod -a -G kolla designate

View File

@ -1,26 +1,21 @@
FROM {{ namespace }}/{{ image_prefix }}designate-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}designate-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %} {% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
{% set designate_central_packages = ['openstack-designate-central'] %}
RUN yum -y install \
openstack-designate-central \
&& yum clean all
{% elif base_distro in ['ubuntu']%} {% elif base_distro in ['ubuntu']%}
{% set designate_central_packages = ['designate-central'] %}
RUN apt-get -y install --no-install-recommends \
designate-central \
&& apt-get clean
{% endif %} {% endif %}
RUN {{ macros.install_packages(designate_central_packages | customizable("packages")) }}
{% endif %} {% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start RUN chmod 755 /usr/local/bin/kolla_extend_start
{% block designate_central_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }} {{ include_footer }}
USER designate USER designate

View File

@ -1,22 +1,18 @@
FROM {{ namespace }}/{{ image_prefix }}designate-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}designate-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %} {% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
{% set designate_mdns_packages = ['openstack-designate-mdns'] %}
RUN yum -y install \
openstack-designate-mdns \
&& yum clean all
{% elif base_distro in ['ubuntu'] %} {% elif base_distro in ['ubuntu'] %}
{% set designate_mdns_packages = ['designate-mdns'] %}
RUN apt-get -y install --no-install-recommends \
designate-mdns \
&& apt-get clean
{% endif %} {% endif %}
RUN {{ macros.install_packages(designate_mdns_packages | customizable("packages")) }}
{% endif %} {% endif %}
{% block designate_mdns_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }} {{ include_footer }}
USER designate USER designate

View File

@ -0,0 +1,25 @@
FROM {{ namespace }}/{{ image_prefix }}designate-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
# The bind9 package here is only to provide the rndc binary.
{% set designate_pool_manager_packages = [
'bind',
'openstack-designate-pool-manager'
] %}
{% elif base_distro in ['ubuntu'] %}
{% set designate_pool_manager_packages = [
'bind9',
'designate-pool-manager'
] %}
{% endif %}
RUN {{ macros.install_packages(designate_pool_manager_packages | customizable("packages")) }}
{% endif %}
{% block designate_pool_manager_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER designate

View File

@ -1,25 +0,0 @@
FROM {{ namespace }}/{{ image_prefix }}designate-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
# The bind9 package here is only to provide the rndc binary.
RUN yum -y install \
bind \
openstack-designate-pool-manager \
&& yum clean all
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
bind9 \
designate-pool-manager \
&& apt-get clean
{% endif %}
{% endif %}
{{ include_footer }}
USER designate

View File

@ -1,24 +1,24 @@
FROM {{ namespace }}/{{ image_prefix }}designate-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}designate-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %} {% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
{% set designate_sink_packages = [
RUN yum -y install \ 'openstack-designate-sink',
openstack-designate-sink \ 'python-designateclient'
python-designateclient \ ] %}
&& yum clean all
{% elif base_distro in ['ubuntu'] %} {% elif base_distro in ['ubuntu'] %}
{% set designate_sink_packages = [
RUN apt-get -y install --no-install-recommends \ 'designate-sink',
designate-sink \ 'designateclient'
designateclient \ ] %}
&& apt-get clean
{% endif %} {% endif %}
RUN {{ macros.install_packages(designate_sink_packages | customizable("packages")) }}
{% endif %} {% endif %}
{% block designate_sink_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }} {{ include_footer }}
USER designate USER designate