From 7a5b6836c16e6ae5be6b406c681571a408a3f327 Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Fri, 27 Jul 2018 15:58:10 +0200 Subject: [PATCH] skydive: use packages on rpm based distros Change-Id: Ifd665a81822c042ee03f6b11da57593472e0a1cb --- docker/skydive/skydive-agent/Dockerfile.j2 | 5 ++++- docker/skydive/skydive-analyzer/Dockerfile.j2 | 11 +++++++++++ docker/skydive/skydive-base/Dockerfile.j2 | 14 ++++++++++---- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/docker/skydive/skydive-agent/Dockerfile.j2 b/docker/skydive/skydive-agent/Dockerfile.j2 index 204aacead3..35862deeeb 100644 --- a/docker/skydive/skydive-agent/Dockerfile.j2 +++ b/docker/skydive/skydive-agent/Dockerfile.j2 @@ -7,7 +7,10 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% block skydive_agent_install %} {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} - {% set skydive_agent_packages = ['openvswitch'] %} + {% set skydive_agent_packages = [ + 'openvswitch', + 'skydive-agent' + ] %} {% elif base_distro in ['debian', 'ubuntu'] %} {% set skydive_agent_packages = ['openvswitch-common'] %} {% endif %} diff --git a/docker/skydive/skydive-analyzer/Dockerfile.j2 b/docker/skydive/skydive-analyzer/Dockerfile.j2 index 409076daf8..a81a92cfaf 100644 --- a/docker/skydive/skydive-analyzer/Dockerfile.j2 +++ b/docker/skydive/skydive-analyzer/Dockerfile.j2 @@ -2,7 +2,18 @@ FROM {{ namespace }}/{{ image_prefix }}skydive-base:{{ tag }} LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" {% block skydive_analyzer_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% block skydive_analyzer_install %} +{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + {% set skydive_analyzer_packages = ['skydive-analyzer'] %} +{{ macros.install_packages(skydive_analyzer_packages | customizable("packages")) }} +{% endif %} +{% endblock %} + {% block skydive_analyzer_footer %}{% endblock %} + {% block footer %}{% endblock %} USER skydive diff --git a/docker/skydive/skydive-base/Dockerfile.j2 b/docker/skydive/skydive-base/Dockerfile.j2 index c3ded88a17..5b6bb13cc5 100644 --- a/docker/skydive/skydive-base/Dockerfile.j2 +++ b/docker/skydive/skydive-base/Dockerfile.j2 @@ -7,14 +7,20 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {{ macros.configure_user(name='skydive') }} -{% if base_arch == 'x86_64' %} - {% block skydive_install %} +{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} + {% set skydive_base_packages = ['skydive'] %} +{{ macros.install_packages(skydive_base_packages | customizable("packages")) }} +{% else %} + {% if base_arch != 'x86_64' %} +RUN echo '{{ install_type }} on {{ base_distro }} not yet available on non x86_64 platforms' \ + && /bin/false + {% else %} RUN curl -o /usr/bin/skydive -L "https://github.com/skydive-project/skydive/releases/download/v0.18.0/skydive" \ && chmod +x /usr/bin/skydive -{% endblock %} - + {% endif %} {% endif %} +{% endblock %} COPY extend_start.sh /usr/local/bin/kolla_extend_start RUN chmod 755 /usr/local/bin/kolla_extend_start