Skip to content
Snippets Groups Projects
Commit 727173f4 authored by Christian Berendt's avatar Christian Berendt
Browse files

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
parent b6e51e95
No related branches found
No related tags found
No related merge requests found
...@@ -12,8 +12,8 @@ ENV KOLLA_INSTALL_METATYPE {{ install_metatype }} ...@@ -12,8 +12,8 @@ ENV KOLLA_INSTALL_METATYPE {{ install_metatype }}
#### Customize PS1 to be used with bash shell #### Customize PS1 to be used with bash shell
COPY kolla_bashrc /tmp/ COPY kolla_bashrc /tmp/
RUN cat /tmp/kolla_bashrc >> /etc/skel/.bashrc RUN cat /tmp/kolla_bashrc >> /etc/skel/.bashrc \
RUN cat /tmp/kolla_bashrc >> /root/.bashrc && cat /tmp/kolla_bashrc >> /root/.bashrc
# PS1 var when used /bin/sh shell # PS1 var when used /bin/sh shell
ENV PS1="$(tput bold)($(printenv KOLLA_SERVICE_NAME))$(tput sgr0)[$(id -un)@$(hostname -s) $(pwd)]$ " 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 ...@@ -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'] %} {% 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 \ 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 echo "Only supported {{ supported_distro_release }} release on {{ base_distro }}"; false; \
fi \
# Customize PS1 bash shell && cat /tmp/kolla_bashrc >> /etc/bashrc
RUN cat /tmp/kolla_bashrc >> /etc/bashrc
#### BEGIN REPO ENABLEMENT #### BEGIN REPO ENABLEMENT
# Turns on Elasticsearch repos # Turns on Elasticsearch repos
...@@ -42,9 +41,8 @@ COPY kibana.yum.repo /etc/yum.repos.d/kibana.yum.repo ...@@ -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 COPY mariadb.yum.repo /etc/yum.repos.d/MariaDB.repo
RUN yum -y install \ RUN yum -y install \
http://repo.percona.com/release/7/RPMS/x86_64/percona-release-0.1-3.noarch.rpm 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 \
RUN rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB \
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-Percona \ && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-Percona \
&& rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch && rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
...@@ -104,8 +102,6 @@ RUN yum -y install \ ...@@ -104,8 +102,6 @@ RUN yum -y install \
tar \ tar \
yum-utils \ yum-utils \
http://mirror.centos.org/centos-7/7/extras/x86_64/Packages/epel-release-7-5.noarch.rpm \ 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 \ && rpm -Uvh --nodeps \
http://buildlogs.centos.org/centos/7/cloud/x86_64/openstack-mitaka/centos-release-openstack-mitaka-1-3.el7.noarch.rpm \ 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 \ 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 \ ...@@ -115,11 +111,10 @@ RUN yum -y install \
&& sed -i 's/\$releasever/7/g' /etc/yum.repos.d/CentOS-*.repo \ && 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-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-Storage \
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization \
&& yum-config-manager --enable ol7_optional_latest ol7_addons \
RUN yum-config-manager --enable ol7_optional_latest ol7_addons && yum -y install \
RUN yum -y install \ yum-plugin-priorities \
yum-plugin-priorities \
&& yum clean all && yum clean all
{% endif %} {% endif %}
...@@ -144,11 +139,8 @@ RUN yum -y install \ ...@@ -144,11 +139,8 @@ RUN yum -y install \
if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] #} if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] #}
RUN yum -y update \ RUN yum -y update \
&& yum clean all && yum -y install \
yum-plugin-versionlock \
# Pin package versions
RUN yum -y install \
yum-plugin-versionlock \
&& yum clean all && yum clean all
COPY versionlock.list /etc/yum/pluginconf.d/ COPY versionlock.list /etc/yum/pluginconf.d/
...@@ -255,8 +247,7 @@ COPY curlrc /root/.curlrc ...@@ -255,8 +247,7 @@ COPY curlrc /root/.curlrc
RUN touch /usr/local/bin/kolla_extend_start \ 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 755 /usr/local/bin/kolla_start /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_set_configs \
&& chmod 440 /etc/sudoers \ && chmod 440 /etc/sudoers \
&& groupadd kolla && groupadd kolla \
&& rm -f /tmp/kolla_bashrc
RUN rm -f /tmp/kolla_bashrc
CMD ["kolla_start"] CMD ["kolla_start"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment