kolla-ansible/docker/designate/designate-base/Dockerfile.j2
Shaun Smekel a9d08726f5 Handle empty package list for install_packages
Currently if the install_packages macro is run with an empty
package list, it will add a yum or apt-get command with no
packages listed.

This bug fix aims to omit this line when no packages have
been given, or, the operator wants to use the "_override" /
"_remove" functionality to disable all packages being
installed in a Dockerfile.

Co-Authored-By: Paul Bourke <paul.bourke@oracle.com>
Change-Id: Ifaaaebfccc3adb0f2f68a35ac08e59378bc87fdb
Closes-bug: 1612446
2016-08-19 10:49:03 +00:00

57 lines
2.3 KiB
Django/Jinja

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'] %}
# Install designate-api because of /etc/designate/policy.json, which
# is needed in all services. This is probably a packaging bug. We do
# need the complete policy file because of some of the containers'
# requiring it. Remove the package when the file is moved though.
{% set designate_base_packages = [
'openstack-designate-api',
'openstack-designate-common',
'python-tooz',
'python2-oslo-reports',
'python2-suds'
] %}
{{ macros.install_packages(designate_base_packages | customizable("packages")) }}
RUN cp /etc/designate/policy.json /tmp/ \
&& rpm -e openstack-designate-api \
&& mv /tmp/policy.json /etc/designate/ \
&& chown designate: /etc/designate/policy.json
{% elif base_distro in ['ubuntu'] %}
{% set designate_base_packages = [
'designate-common',
'python-tooz'
] %}
{{ macros.install_packages(designate_base_packages | customizable("packages")) }}
{% endif %}
{% elif install_type == 'source' %}
ADD designate-base-archive /designate-base-source
RUN ln -s designate-base-source/* designate \
&& useradd --user-group designate \
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /designate \
&& mkdir -p /etc/designate /var/log/designate /home/designate \
&& cp -r /designate/etc/designate/* /etc/designate/ \
&& mv /etc/designate/rootwrap.conf.sample /etc/designate/rootwrap.conf \
&& 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
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_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
{% block designate_base_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
RUN usermod -a -G kolla designate