@@ -50,59 +50,9 @@ zypper -n ar --refresh --gpgcheck --priority 100 --enable 'https://public-dl.sus
5050zypper -n ar --refresh --gpgcheck --priority 100 --disable ' https://public-dl.suse.com/SUSE/Products/SLE-BCI/$releasever_major.$releasever_minor/$basearch/product_debug/' SLE_BCI_debug
5151zypper -n ar --refresh --gpgcheck --priority 100 --disable ' https://public-dl.suse.com/SUSE/Products/SLE-BCI/$releasever_major.$releasever_minor/$basearch/product_source/' SLE_BCI_source
5252
53- # ======================================
54- # Remove zypp uuid (bsc#1098535)
55- # --------------------------------------
56- rm -f /var/lib/zypp/AnonymousUniqueId
57-
58- # Remove the entire zypper cache content (not the dir itself, owned by libzypp)
59- rm -rf /var/cache/zypp/*
60-
61- # drop timestamp
62- tail -n +2 /var/lib/zypp/AutoInstalled > /var/lib/zypp/AutoInstalled.new && mv /var/lib/zypp/AutoInstalled.new /var/lib/zypp/AutoInstalled
63-
64- # drop useless device/inode specific cache file (see https://github.com/docker-library/official-images/issues/16044)
65- rm -vf /var/cache/ldconfig/aux-cache
66-
67- # remove backup of /etc/{shadow,group,passwd} and lock file
68- rm -vf /etc/{shadow-,group-,passwd-,.pwd.lock}
69-
70- # drop pid and lock files
71- rm -vrf /run/*
72- rm -vf /usr/lib/sysimage/rpm/.rpm.lock
73-
74- # set the day of last password change to empty
75- sed -i ' s/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /etc/shadow
76-
77- # ==========================================
78- # Hack! The go container management tools can't handle sparse files:
79- # https://github.com/golang/go/issues/13548
80- # If lastlog doesn't exist, useradd doesn't attempt to reserve space,
81- # also in derived containers.
82- # ------------------------------------------
83- rm -f /var/log/lastlog
84-
8553# ======================================
8654# Remove locale files
8755# --------------------------------------
8856(shopt -s globstar; rm -f /usr/share/locale/** /* .mo)
8957
90- # =======================================
91- # Clean up after zypper if it is present
92- # ---------------------------------------
93- if command -v zypper > /dev/null; then
94- zypper -n clean -a
95- fi
96-
97- # =============================================
98- # Clean up logs and temporary files if present
99- # ---------------------------------------------
100- rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}; \
101- rm -rf {/target,}/run/* ; \
102- rm -f {/target,}/etc/{shadow-,group-,passwd-,.pwd.lock}; \
103- rm -f {/target,}/usr/lib/sysimage/rpm/.rpm.lock; \
104- rm -f {/target,}/var/cache/ldconfig/aux-cache; \
105- command -v zypper > /dev/null 2>&1 || rm -f /var/lib/zypp/AutoInstalled
106-
107-
10858exit 0
0 commit comments