aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorChristian Berendt <berendt@betacloud-solutions.de>2016-06-25 16:59:01 +0200
committerChristian Berendt <berendt@betacloud-solutions.de>2016-06-29 13:31:07 +0200
commit727173f4bebe84c1310c6fa27797a42812a49031 (patch)
treec604ea64511afa59973dce8fbafab542b07407cd /docker
parentb6e51e9531caaa6bda58de5c91e288763c588de2 (diff)
downloadkolla-727173f4bebe84c1310c6fa27797a42812a49031.tar.gz
kolla-727173f4bebe84c1310c6fa27797a42812a49031.zip
Cleanup RUN commands in base Dockerfile
This will merge several RUN statements into one RUN statement to reduce the number of the layers of the base Docker image. TrivialFix Change-Id: I69b00b2e7fa7717923f0fe364c5be9b38a2dbb90
Diffstat (limited to 'docker')
-rw-r--r--docker/base/Dockerfile.j239
1 files changed, 15 insertions, 24 deletions
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2
index 62a1df652..686cd3f5c 100644
--- a/docker/base/Dockerfile.j2
+++ b/docker/base/Dockerfile.j2
@@ -12,8 +12,8 @@ ENV KOLLA_INSTALL_METATYPE {{ install_metatype }}
#### Customize PS1 to be used with bash shell
COPY kolla_bashrc /tmp/
-RUN cat /tmp/kolla_bashrc >> /etc/skel/.bashrc
-RUN cat /tmp/kolla_bashrc >> /root/.bashrc
+RUN cat /tmp/kolla_bashrc >> /etc/skel/.bashrc \
+ && cat /tmp/kolla_bashrc >> /root/.bashrc
# PS1 var when used /bin/sh shell
ENV PS1="$(tput bold)($(printenv KOLLA_SERVICE_NAME))$(tput sgr0)[$(id -un)@$(hostname -s) $(pwd)]$ "
@@ -26,10 +26,9 @@ ENV PS1="$(tput bold)($(printenv KOLLA_SERVICE_NAME))$(tput sgr0)[$(id -un)@$(ho
{% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %}
RUN if [ $(awk '{match($0, /[0-9]+/,version)}END{print version[0]}' /etc/system-release) != "{{ supported_distro_release }}" ]; then \
- echo "Only supported {{ supported_distro_release }} release on {{ base_distro }}"; false; fi
-
-# Customize PS1 bash shell
-RUN cat /tmp/kolla_bashrc >> /etc/bashrc
+ echo "Only supported {{ supported_distro_release }} release on {{ base_distro }}"; false; \
+ fi \
+ && cat /tmp/kolla_bashrc >> /etc/bashrc
#### BEGIN REPO ENABLEMENT
# Turns on Elasticsearch repos
@@ -42,9 +41,8 @@ COPY kibana.yum.repo /etc/yum.repos.d/kibana.yum.repo
COPY mariadb.yum.repo /etc/yum.repos.d/MariaDB.repo
RUN yum -y install \
- http://repo.percona.com/release/7/RPMS/x86_64/percona-release-0.1-3.noarch.rpm
-
-RUN rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB \
+ http://repo.percona.com/release/7/RPMS/x86_64/percona-release-0.1-3.noarch.rpm \
+ && rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB \
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-Percona \
&& rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
@@ -104,8 +102,6 @@ RUN yum -y install \
tar \
yum-utils \
http://mirror.centos.org/centos-7/7/extras/x86_64/Packages/epel-release-7-5.noarch.rpm \
- && yum clean all \
- # TODO(pbourke): replace with mirror.centos.org once openstack-mitaka-1-3 is promoted to stable
&& rpm -Uvh --nodeps \
http://buildlogs.centos.org/centos/7/cloud/x86_64/openstack-mitaka/centos-release-openstack-mitaka-1-3.el7.noarch.rpm \
http://mirror.centos.org/centos-7/7/extras/x86_64/Packages/centos-release-ceph-hammer-1.0-5.el7.centos.noarch.rpm \
@@ -115,11 +111,10 @@ RUN yum -y install \
&& sed -i 's/\$releasever/7/g' /etc/yum.repos.d/CentOS-*.repo \
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 \
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage \
- && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization
-
-RUN yum-config-manager --enable ol7_optional_latest ol7_addons
-RUN yum -y install \
- yum-plugin-priorities \
+ && 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 \
&& yum clean all
{% endif %}
@@ -144,11 +139,8 @@ RUN yum -y install \
if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] #}
RUN yum -y update \
- && yum clean all
-
-# Pin package versions
-RUN yum -y install \
- yum-plugin-versionlock \
+ && yum -y install \
+ yum-plugin-versionlock \
&& yum clean all
COPY versionlock.list /etc/yum/pluginconf.d/
@@ -255,8 +247,7 @@ COPY curlrc /root/.curlrc
RUN touch /usr/local/bin/kolla_extend_start \
&& chmod 755 /usr/local/bin/kolla_start /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_set_configs \
&& chmod 440 /etc/sudoers \
- && groupadd kolla
-
-RUN rm -f /tmp/kolla_bashrc
+ && groupadd kolla \
+ && rm -f /tmp/kolla_bashrc
CMD ["kolla_start"]