We have the following block in our Dockerfile
:
RUN yum -y updateRUN yum -y install epel-releaseRUN yum -y groupinstall "Development Tools"RUN yum -y install python-pip git mysql-devel libxml2-devel libxslt-devel python-devel openldap-devel libffi-devel openssl-devel
I've been told that we should unite these RUN
commands to cut down on created docker layers:
RUN yum -y update \&& yum -y install epel-release \&& yum -y groupinstall "Development Tools" \&& yum -y install python-pip git mysql-devel libxml2-devel libxslt-devel python-devel openldap-devel libffi-devel openssl-devel
I'm very new to docker and not sure I completely understand the differences between these two versions of specifying multiple RUN commands. When would one unite RUN
commands into a single one and when it makes sense to have multiple RUN
commands?