From 04e1ba3b6e3e9aa85c9c12c37d66ea9f020a07c8 Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Tue, 24 Oct 2023 07:33:29 -0400 Subject: [PATCH] Only base containers should have tzdata The base container should always install tzdata to ensure that it is available for applications built on top of the base container. The minimal container should never have tzdata installed, and the application should install it as part of the application dependencies. Starting with Fedora 39 we have the capability to remove tzdata from the minimal images without resorting to deleting files: https://fedoraproject.org/wiki/Changes/AllowRemovalOfTzdata --- fedora-container-base-minimal.ks | 7 +------ fedora-container-common.ks | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/fedora-container-base-minimal.ks b/fedora-container-base-minimal.ks index 9a92ce9..5d62aa9 100644 --- a/fedora-container-base-minimal.ks +++ b/fedora-container-base-minimal.ks @@ -6,7 +6,7 @@ %packages --excludedocs --instLangs=en --nocore --excludeWeakdeps microdnf - +-tzdata %end %post --erroronfail --log=/root/anaconda-post.log @@ -33,11 +33,6 @@ rm -fv /usr/bin/pinky # we lose presets by removing /usr/lib/systemd but we do not care rm -rfv /usr/lib/systemd -# if you want to change the timezone, bind-mount it from the host or reinstall tzdata -rm -fv /etc/localtime -mv /usr/share/zoneinfo/UTC /etc/localtime -rm -rfv /usr/share/zoneinfo - # Final pruning rm -rfv /var/cache/* /var/log/* /tmp/* diff --git a/fedora-container-common.ks b/fedora-container-common.ks index 3637c89..644859d 100644 --- a/fedora-container-common.ks +++ b/fedora-container-common.ks @@ -35,6 +35,7 @@ fedora-release-container bash coreutils glibc-minimal-langpack +tzdata rpm util-linux-core -kernel