aboutsummaryrefslogtreecommitdiff
path: root/docker/macros.j2
diff options
context:
space:
mode:
Diffstat (limited to 'docker/macros.j2')
-rw-r--r--docker/macros.j26
1 files changed, 4 insertions, 2 deletions
diff --git a/docker/macros.j2 b/docker/macros.j2
index 3e1353e71..dcc9bb0bb 100644
--- a/docker/macros.j2
+++ b/docker/macros.j2
@@ -1,14 +1,16 @@
{% macro install_packages(packages) -%}
{% if packages is defined and packages|length > 0 -%}
{% if base_package_type == 'rpm' -%}
- RUN {{ distro_package_manager }} -y install {{ packages | join(' ') }} && {{ distro_package_manager }} clean all && rm -rf /var/cache/{{ distro_package_manager }}
+ RUN {{ distro_package_manager }} -y install {{ packages | join(' ') }}
+ {%- if clean_package_cache %} \
+ && {{ distro_package_manager }} clean all && rm -rf /var/cache/{{ distro_package_manager }}{% endif %}
{%- elif base_package_type == 'deb' -%}
{#-
debian_package_install is a utility method to build up an appropriate
set of commands to install packages in a debian-based environment that
may include URL links to a .deb package
-#}
- RUN {{ debian_package_install(packages) }}
+ RUN {{ debian_package_install(packages, clean_package_cache) }}
{%- endif %}
{%- endif %}
{%- endmacro %}