summaryrefslogtreecommitdiff
path: root/docker/base
diff options
context:
space:
mode:
authorJon Schlueter <jschluet@redhat.com>2019-03-15 15:47:30 -0400
committerJon Schlueter <jschluet@redhat.com>2019-03-21 13:20:48 -0400
commit95f38fb0f6056ef201d96e141732b32e97338e97 (patch)
tree25a7e75776535fe1ea1babf2876477cfd5c6678a /docker/base
parent91c5453cc21491df42cc738583b646ca7afec08e (diff)
downloadkolla-95f38fb0f6056ef201d96e141732b32e97338e97.tar.gz
kolla-95f38fb0f6056ef201d96e141732b32e97338e97.zip
cleanup in base for yum install entries
- introduce install_packages(..., chain=True) to allow chaining on onto existing RUN commands - introduce install_packages(..., clean) which defaults correctly but allows you to override if you want to avoid doing extra package manager cleanup - refactored several calls in base to make use of these new features In general this allows for macros.install_packages to be chained after other calls for example RUN foo && {{ macros.install_packages(..., chain=True) }} Change-Id: I4b2fe8e13ee3c0fffe77a1179a7af5b534496996
Diffstat (limited to 'docker/base')
-rw-r--r--docker/base/Dockerfile.j214
1 files changed, 4 insertions, 10 deletions
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2
index cf1f8e437..18212f0bb 100644
--- a/docker/base/Dockerfile.j2
+++ b/docker/base/Dockerfile.j2
@@ -166,11 +166,9 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
# Enable couple required repositories for all RHEL builds
# Turn on EPEL throughout the build
RUN yum-config-manager --enable rhel-7-server-optional-rpms \
- && yum -y install \
- yum-plugin-priorities \
+ && {{ macros.install_packages( ['yum-plugin-priorities' ], chain=True, clean=False) }} \
{%- if install_type != 'binary' or install_metatype != 'rdo' %}
- && yum -y install \
- https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
+ && {{ macros.install_packages( [ 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm' ], chain=True, clean=False) }} \
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 \
{% endif -%}
&& yum-config-manager --enable rhel-7-server-extras-rpms \
@@ -187,10 +185,7 @@ RUN yum-config-manager --enable rhel-7-server-optional-rpms \
{% block base_oraclelinux_package_installation %}
COPY oraclelinux-extras.repo /etc/yum.repos.d/oraclelinux-extras.repo
-RUN yum -y install \
- tar \
- yum-utils \
- https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
+RUN {{ macros.install_packages( ['tar', 'yum-utils', 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm' ], chain=True, clean=False) }} \
&& rpm -Uvh --nodeps \
http://mirror.centos.org/centos-7/7/extras/x86_64/Packages/centos-release-ceph-luminous-1.1-2.el7.centos.noarch.rpm \
http://mirror.centos.org/centos-7/7/extras/x86_64/Packages/centos-release-opstools-1-8.el7.noarch.rpm \
@@ -203,8 +198,7 @@ RUN yum -y install \
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage \
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization \
&& yum-config-manager --enable ol7_optional_latest ol7_addons \
- && yum -y install \
- yum-plugin-priorities \
+ && {{ macros.install_packages( ['yum-plugin-priorities' ], chain=True, clean=False) }} \
&& {{ macros.rpm_security_update(clean_package_cache) }}
{% endblock %}