kolla/docker/bifrost/bifrost-base/Dockerfile.j2
Marcin Juszkiewicz 69fef5cd59 debian: enable all images enabled for Ubuntu
Debian support is not maintained in Kolla so it got a bit behind Ubuntu
one. This changeset enables Debian for all images. Jessie (even with
backports) may be too old for some images though.

Also unify distro check to ['debian', 'ubuntu'] to keep alphabetical order
like it is done for RPM distributions.

Partially-Implements: blueprint multiarch-and-arm64-containers

Change-Id: I056233fbfa277e0e2360c07c3f80d9558c554357
2017-04-04 22:48:18 +02:00

52 lines
1.4 KiB
Django/Jinja

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 %}