summaryrefslogtreecommitdiff
path: root/docker/monasca/monasca-api/Dockerfile.j2
blob: e9f7b5235ef7de2f876de7c36054133bf6e994c5 (plain)
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
FROM {{ namespace }}/{{ image_prefix }}monasca-base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"

{% block monasca_api_header %}{% endblock %}

{% import "macros.j2" as macros with context %}

{% if install_type == 'binary' %}

RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
    && /bin/false

{% elif install_type == 'source' %}

    {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
        {% set monasca_api_packages = [
            'mariadb',
        ] %}
    {% elif base_distro in ['debian', 'ubuntu'] %}
        {% set monasca_api_packages = [
            'mariadb-client',
        ] %}
    {% endif %}
{{ macros.install_packages(monasca_api_packages | customizable("packages")) }}

ADD monasca-api-archive /monasca-api-source

{% set monasca_api_pip_packages = [
    'influxdb',
    '/monasca-api'
] %}

RUN ln -s monasca-api-source/* monasca-api \
    && {{ macros.install_pip(monasca_api_pip_packages | customizable("pip_packages")) }}

{% endif %}

COPY extend_start.sh /usr/local/bin/kolla_monasca_extend_start
RUN chmod 755 /usr/local/bin/kolla_monasca_extend_start

{% block monasca_api_footer %}{% endblock %}

{% block footer %}{% endblock %}