From 6b960ec03126dc3bd6a3c0cdcffefa4bad34fa61 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 16 Jun 2020 06:26:33 -0400 Subject: [PATCH] Cleanup Dockerfile builds Add `-y` options to yum clean all Only delete below /var/cache/dnf so that I can use the -v /var/cache/dnf:/var/cache/dnf:O option when building to speed up builds. Signed-off-by: Daniel J Walsh --- contrib/skopeoimage/stable/Dockerfile | 2 +- contrib/skopeoimage/testing/Dockerfile | 2 +- contrib/skopeoimage/upstream/Dockerfile | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/skopeoimage/stable/Dockerfile b/contrib/skopeoimage/stable/Dockerfile index e984629c21..aac4601b10 100644 --- a/contrib/skopeoimage/stable/Dockerfile +++ b/contrib/skopeoimage/stable/Dockerfile @@ -13,7 +13,7 @@ FROM registry.fedoraproject.org/fedora:32 # up space. Also reinstall shadow-utils as without # doing so, the setuid/setgid bits on newuidmap # and newgidmap are lost in the Fedora images. -RUN useradd skopeo; yum -y update; yum -y reinstall shadow-utils; yum -y install skopeo fuse-overlayfs --exclude container-selinux; yum clean all; rm -rf /var/cache /var/log/dnf* /var/log/yum.*; +RUN useradd skopeo; yum -y update; yum -y reinstall shadow-utils; yum -y install skopeo fuse-overlayfs --exclude container-selinux; yum -y clean all; rm -rf /var/cache/dnf/* /var/log/dnf* /var/log/yum* # Adjust storage.conf to enable Fuse storage. RUN sed -i -e 's|^#mount_program|mount_program|g' -e '/additionalimage.*/a "/var/lib/shared",' -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' /etc/containers/storage.conf diff --git a/contrib/skopeoimage/testing/Dockerfile b/contrib/skopeoimage/testing/Dockerfile index 1b01405db9..39c0ac1d7a 100644 --- a/contrib/skopeoimage/testing/Dockerfile +++ b/contrib/skopeoimage/testing/Dockerfile @@ -14,7 +14,7 @@ FROM registry.fedoraproject.org/fedora:32 # up space. Also reinstall shadow-utils as without # doing so, the setuid/setgid bits on newuidmap # and newgidmap are lost in the Fedora images. -RUN useradd skopeo; yum -y update; yum -y reinstall shadow-utils; yum -y install skopeo fuse-overlayfs --enablerepo updates-testing --exclude container-selinux; yum clean all; rm -rf /var/cache /var/log/dnf* /var/log/yum.*; +RUN useradd skopeo; yum -y update; yum -y reinstall shadow-utils; yum -y install skopeo fuse-overlayfs --enablerepo updates-testing --exclude container-selinux; yum -y clean all; rm -rf /var/cache/dnf/* /var/log/dnf* /var/log/yum* # Adjust storage.conf to enable Fuse storage. RUN sed -i -e 's|^#mount_program|mount_program|g' -e '/additionalimage.*/a "/var/lib/shared",' -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' /etc/containers/storage.conf diff --git a/contrib/skopeoimage/upstream/Dockerfile b/contrib/skopeoimage/upstream/Dockerfile index e50f338b71..6d2b60be46 100644 --- a/contrib/skopeoimage/upstream/Dockerfile +++ b/contrib/skopeoimage/upstream/Dockerfile @@ -33,7 +33,8 @@ make binary-local;\ make install;\ rm -rf /root/skopeo/*; \ yum -y remove git golang go-md2man make; \ -yum clean all; rm -rf /var/cache /var/log/dnf* /var/log/yum.*; +yum -y clean all; yum -y clean all; rm -rf /var/cache/dnf/* /var/log/dnf* /var/log/yum* + # Adjust storage.conf to enable Fuse storage. RUN sed -i -e 's|^#mount_program|mount_program|g' -e '/additionalimage.*/a "/var/lib/shared",' -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' /etc/containers/storage.conf