kolla/docker/bifrost/bifrost-base/Dockerfile.j2
Mark Goddard 840fa07f18 Use rabbitmq package from OS distro for Bifrost
The recent change to upgrade RabbitMQ broke deployment of Bifrost, since
it does not support the newer version of RabbitMQ. This change reverts
the bifrost image to use the package provided by the OS.

Change-Id: Id6c9b879727734ea2c03b2d69e1a673354f52617
2018-10-02 12:14:18 +01:00

62 lines
1.9 KiB
Django/Jinja

FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block bifrost_base_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{{ macros.configure_user(name='bifrost') }}
{% if install_type == 'binary' %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' && /bin/false
{% elif install_type == 'source' %}
ENV VENV /var/lib/kolla/venv
{% set bifrost_base_pip_packages = [
'/bifrost'
] %}
ADD bifrost-base-archive /bifrost-base-source
COPY build_arg.yml /tmp/build_arg.yml
RUN ln -s bifrost-base-source/* bifrost \
&& {{ macros.install_pip(bifrost_base_pip_packages | customizable("pip_packages")) }}
WORKDIR /bifrost
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{# Remove updated RabbitMQ packages since these are not supported by Bifrost yet. #}
RUN rm -f /etc/yum.repos.d/rabbitmq_rabbitmq-server.repo \
&& yum clean all && rm -rf /var/yum/cache
{% elif base_distro in ['debian', 'ubuntu'] %}
RUN sed -e "s/.*mariadb.*//Ig" -e "s/.*rabbitmq.*//Ig" -i /etc/apt/sources.list \
&& apt-get purge -y mariadb* mysql*
{% endif %}
{% block bifrost_ansible_install %}
{% if base_distro in ['debian', 'ubuntu'] %}
RUN apt-get update && \
{% else %}
RUN echo " " && \
{% endif %}
bash -c './scripts/env-setup.sh && source ./env-vars && \
ansible-playbook -vvvv -i /bifrost/playbooks/inventory/target /bifrost/playbooks/install.yaml \
-e @/tmp/build_arg.yml && \
{% if base_distro in ['debian', 'ubuntu'] %}
apt-get clean && rm -rf /var/lib/apt/lists/*'
{% else %}
yum clean all && rm -rf /var/yum/cache'
{% endif %}
{% endblock %}
{% endif %}
COPY bifrost_sudoers /etc/sudoers.d/kolla_bifrost_sudoers
RUN chmod 750 /etc/sudoers.d \
&& chmod 440 /etc/sudoers.d/kolla_bifrost_sudoers \
&& chown -R bifrost:bifrost /bifrost
{% block bifrost_base_footer %}{% endblock %}