From: Michael Tremer Date: Sat, 23 Sep 2017 21:33:50 +0000 (+0100) Subject: docker: Cleanup temporary files when ever they are created X-Git-Tag: 0.9.28~1292 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=178d60b66a680d75450808e971ea9cebb0812088;p=pakfire.git docker: Cleanup temporary files when ever they are created docker keeps files that are deleted later still in the layer where they have been created. To keep that to a minimum, we can remove any temporary data where ever possible. Signed-off-by: Michael Tremer --- diff --git a/Dockerfile.in b/Dockerfile.in index ea3e4febe..60c41c6d0 100644 --- a/Dockerfile.in +++ b/Dockerfile.in @@ -8,10 +8,10 @@ LABEL \ org.ipfire.pakfire.version = "@PACKAGE_VERSION@" # Update all OS packages -RUN yum update -y +RUN yum update -y && yum clean all # Add EPEL -RUN yum install -y epel-release +RUN yum install -y epel-release && yum clean all # Install all dependencies RUN yum install -y \ @@ -27,7 +27,7 @@ RUN yum install -y \ libsolv-devel \ make \ python-devel \ - xz-devel + xz-devel && yum clean all # Copy the pakfire source code ADD . /build/pakfire @@ -35,13 +35,13 @@ ADD . /build/pakfire WORKDIR /build/pakfire # Compile pakfire -RUN ./autogen.sh && ./configure --prefix=/usr --sysconfdir=/etc && make -j4 && make check && make install +RUN ./autogen.sh && ./configure --prefix=/usr --sysconfdir=/etc && make -j4 && make check && make install && rm -rf /build/pakfire # Go back to /root WORKDIR /root # Cleanup -RUN rm -rf /build/pakfire && yum remove -y *-devel && yum autoremove -y && yum clean all +RUN yum remove -y *-devel && yum autoremove -y && yum clean all USER root