forked from openstack/kolla
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile.j2
More file actions
68 lines (52 loc) · 2.13 KB
/
Copy pathDockerfile.j2
File metadata and controls
68 lines (52 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}
{% block bifrost_base_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{{ macros.configure_user(name='bifrost') }}
{# NOTE(mgoddard): EPEL required for nginx #}
{{ macros.enable_extra_repos(['epel']) }}
{% set bifrost_base_packages = [
'cpio',
] %}
{{ macros.install_packages(bifrost_base_packages | customizable("packages")) }}
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
{# ANSIBLE_GATHER_TIMEOUT is a workaround for https://github.com/ansible/ansible/issues/43884 #}
ENV ANSIBLE_GATHER_TIMEOUT=30
{% block bifrost_ansible_install %}
{%- if base_package_type == 'deb' %}
RUN apt-get --error-on=any update && \
bash -c '$VENV/bin/pip install "ansible>=9,<10" && \
{%- else %}
RUN echo " " && \
bash -c '$VENV/bin/pip install -U "ansible>=8,<9" "setuptools<82" && \
{%- endif %}
$VENV/bin/ansible-galaxy collection install -r /bifrost/ansible-collections-requirements.yml && \
$VENV/bin/ansible-playbook -vvvv -i /bifrost/playbooks/inventory/target \
/bifrost/playbooks/install.yaml \
-e upper_constraints_file="/requirements/upper-constraints.txt" \
-e git_branch={{ openstack_branch_slashed }} \
-e ipa_upstream_release={{ openstack_branch }} \
-e enable_inspector=true \
-e @/tmp/build_arg.yml && \
{%- if base_package_type == 'deb' %}
apt-get clean && rm -rf /var/lib/apt/lists/*'
{%- else %}
dnf clean all && rm -rf /var/dnf/cache'
{%- endif %}
{% endblock %}
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
{{ macros.kolla_patch_sources() }}
{% block bifrost_base_footer %}{% endblock %}