FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }} MAINTAINER {{ maintainer }} {% 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 ['debian', 'ubuntu'] %} RUN sed -e "s/.*mariadb.*//Ig" -i /etc/apt/sources.list && apt-get purge -y mariadb* mysql* {% endif %} {% block bifrost_ansible_install %} RUN 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' {% else %} yum clean all' {% 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 %}