From d7e7fb48f5f50c8fedc7228a3f4c13f324064274 Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Thu, 1 Mar 2018 12:29:53 +0530 Subject: fix bug when multiple shell commands are specified in RUN If RUN is followed by two commands only the return value of second determines whether RUN was successful or not. This may lead to cases where docker build succeeds even when it should not. For example RUN /bin/false; /bin/true would be considered a success. Important thing to consider is that all yum/dnf commands should perform clean in the same RUN operation if we wish to keep the container image size small. Running clean in a second RUN operation leads to bigger image size contrary to expectation because each operation leads to a layer in the image. With the above two points considered, I have replaced ";" with "&&" where necessary and split a single RUN operation to two or many operations in other places. Signed-off-by: Raghavendra Talur --- gluster-client/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gluster-client') diff --git a/gluster-client/Dockerfile b/gluster-client/Dockerfile index 9f28b4e..dc8be95 100644 --- a/gluster-client/Dockerfile +++ b/gluster-client/Dockerfile @@ -14,9 +14,10 @@ LABEL architecture="x86_64" \ ENV container docker -RUN dnf --setopt=tsflags=nodocs -y update; dnf --setopt=tsflags=nodocs -y install wget nfs-utils attr iputils iproute; \ -sed -i "s/LANG/\#LANG/g" /etc/locale.conf;\ -dnf install -y glusterfs-fuse;\ -dnf clean all; +RUN sed -i "s/LANG/\#LANG/g" /etc/locale.conf +RUN dnf --setopt=tsflags=nodocs -y update &&\ +dnf --setopt=tsflags=nodocs -y install wget nfs-utils attr iputils iproute &&\ +dnf install -y glusterfs-fuse &&\ +dnf clean all CMD ["/bin/bash"] -- cgit v1.2.3