summaryrefslogtreecommitdiff
path: root/docker/macros.j2
diff options
context:
space:
mode:
authorChristian Berendt <berendt@betacloud-solutions.de>2017-10-04 15:54:08 +0200
committerMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2017-11-02 13:55:49 +0100
commit4de0706190b2f79aacb63fad3e397ce81f76e2e1 (patch)
tree1e98c91f98847f9d60366c70e516068f2f378e7d /docker/macros.j2
parent93b91ceef6d19eb875d72ad7fe5fd5f8f69f0ffb (diff)
downloadkolla-4de0706190b2f79aacb63fad3e397ce81f76e2e1.tar.gz
kolla-4de0706190b2f79aacb63fad3e397ce81f76e2e1.zip
Cleanup APT lists after installing packages
/var/lib/apt/lists/ can take several MBs so get rid of them after packages are installed. Change-Id: Icfff55d92fa5c865f09db5112da28bf452a5a221
Diffstat (limited to 'docker/macros.j2')
-rw-r--r--docker/macros.j29
1 files changed, 6 insertions, 3 deletions
diff --git a/docker/macros.j2 b/docker/macros.j2
index 06a911b5e..5294ddacf 100644
--- a/docker/macros.j2
+++ b/docker/macros.j2
@@ -49,10 +49,12 @@ RUN usermod --append --home {{ homedir }} --groups kolla {{ name }} \
{% macro debian_haproxy_existing_user_fix() %}
{# NOTE(SamYaple): The postinst script breaks if the user 'haproxy' already exists #}
-RUN apt-get -y install --no-install-recommends haproxy \
+RUN apt-get update \
+ && apt-get -y install --no-install-recommends haproxy \
|| sed -i '/^adduser/,+1 d' /var/lib/dpkg/info/haproxy.postinst \
&& apt-get -y install -f \
- && apt-get clean
+ && apt-get clean \
+ && rm -rf /var/lib/apt/lists/*
{% endmacro %}
{% macro debian_opendaylight_existing_user_fix() %}
@@ -61,7 +63,8 @@ RUN apt-get update \
&& apt-get -y install --no-install-recommends opendaylight \
|| sed -i '/^\s*adduser/,+1 d' /var/lib/dpkg/info/opendaylight.postinst \
&& apt-get -y install -f \
- && apt-get clean
+ && apt-get clean \
+ && rm -rf /var/lib/apt/lists/*
{% endmacro %}
{% macro install_kubectl() %}