Skip to content

Commit 697cc47

Browse files
author
SUSE Update Bot
committed
Test build for #3166
1 parent 4c9892e commit 697cc47

61 files changed

Lines changed: 1210 additions & 734 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

389-ds-image/Dockerfile

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,25 @@ FROM registry.suse.com/bci/bci-base:16.0
2424

2525
RUN set -euo pipefail; \
2626
zypper -n install --no-recommends 389-ds timezone openssl nss_synth
27-
28-
# cleanup logs and temporary files
27+
# image cleanup
2928
RUN set -euo pipefail; zypper -n clean -a; \
30-
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}; \
31-
rm -rf {/target,}/run/*; \
32-
rm -f {/target,}/etc/{shadow-,group-,passwd-,.pwd.lock}; \
33-
rm -f {/target,}/usr/lib/sysimage/rpm/.rpm.lock; \
34-
rm -f {/target,}/var/cache/ldconfig/aux-cache; \
35-
command -v zypper >/dev/null 2>&1 || rm -f /var/lib/zypp/AutoInstalled
36-
37-
# set the day of last password change to empty
38-
RUN set -euo pipefail; sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /etc/shadow
29+
rm -vrf /var/log/alternatives.log; \
30+
rm -vrf /var/log/lastlog; \
31+
rm -vrf /var/log/tallylog; \
32+
rm -vrf /var/log/zypper.log; \
33+
rm -vrf /var/log/zypp/history; \
34+
rm -vrf /var/log/YaST2; \
35+
rm -vrf /var/lib/zypp/AnonymousUniqueId; \
36+
rm -vrf /var/cache/zypp/*; \
37+
rm -vrf /run/*; \
38+
rm -vrf /etc/shadow-; \
39+
rm -vrf /etc/group-; \
40+
rm -vrf /etc/passwd-; \
41+
rm -vrf /etc/.pwd.lock; \
42+
rm -vrf /usr/lib/sysimage/rpm/.rpm.lock; \
43+
rm -vrf /var/cache/ldconfig/aux-cache; \
44+
[ -f /var/lib/zypp/AutoInstalled ] && sed -i '1d' /var/lib/zypp/AutoInstalled; \
45+
sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /etc/shadow
3946

4047
# Define labels according to https://en.opensuse.org/Building_derived_containers
4148
# labelprefix=com.suse.application.389-ds

base-fips-image/Dockerfile

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,25 @@ FROM registry.suse.com/bci/bci-base:16.0
2424

2525
RUN set -euo pipefail; \
2626
zypper -n install --no-recommends SLES-release coreutils crypto-policies-scripts patterns-base-fips
27-
28-
# cleanup logs and temporary files
27+
# image cleanup
2928
RUN set -euo pipefail; zypper -n clean -a; \
30-
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}; \
31-
rm -rf {/target,}/run/*; \
32-
rm -f {/target,}/etc/{shadow-,group-,passwd-,.pwd.lock}; \
33-
rm -f {/target,}/usr/lib/sysimage/rpm/.rpm.lock; \
34-
rm -f {/target,}/var/cache/ldconfig/aux-cache; \
35-
command -v zypper >/dev/null 2>&1 || rm -f /var/lib/zypp/AutoInstalled
36-
37-
# set the day of last password change to empty
38-
RUN set -euo pipefail; sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /etc/shadow
29+
rm -vrf /var/log/alternatives.log; \
30+
rm -vrf /var/log/lastlog; \
31+
rm -vrf /var/log/tallylog; \
32+
rm -vrf /var/log/zypper.log; \
33+
rm -vrf /var/log/zypp/history; \
34+
rm -vrf /var/log/YaST2; \
35+
rm -vrf /var/lib/zypp/AnonymousUniqueId; \
36+
rm -vrf /var/cache/zypp/*; \
37+
rm -vrf /run/*; \
38+
rm -vrf /etc/shadow-; \
39+
rm -vrf /etc/group-; \
40+
rm -vrf /etc/passwd-; \
41+
rm -vrf /etc/.pwd.lock; \
42+
rm -vrf /usr/lib/sysimage/rpm/.rpm.lock; \
43+
rm -vrf /var/cache/ldconfig/aux-cache; \
44+
[ -f /var/lib/zypp/AutoInstalled ] && sed -i '1d' /var/lib/zypp/AutoInstalled; \
45+
sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /etc/shadow
3946

4047
# Define labels according to https://en.opensuse.org/Building_derived_containers
4148
# labelprefix=com.suse.bci.base-fips

base-image/config.sh

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -50,59 +50,9 @@ zypper -n ar --refresh --gpgcheck --priority 100 --enable 'https://public-dl.sus
5050
zypper -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
5151
zypper -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-
10858
exit 0

base-image/images.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: MIT
3+
# SPDX-FileCopyrightText: (c) 2022-2025 SUSE LLC
4+
5+
set -euo pipefail
6+
7+
#======================================
8+
# Image Cleanup
9+
#--------------------------------------
10+
if command -v zypper > /dev/null; then
11+
zypper -n clean -a
12+
# drop timestamp
13+
tail -n +2 /var/lib/zypp/AutoInstalled > /var/lib/zypp/AutoInstalled.new && mv /var/lib/zypp/AutoInstalled.new /var/lib/zypp/AutoInstalled
14+
else
15+
# it does not make sense in a zypper-free image
16+
rm -vrf /var/lib/zypp/AutoInstalled
17+
rm -vrf /usr/lib/sysimage/rpm/Index.db
18+
fi
19+
20+
# set the day of last password change to empty
21+
# prefer sed if available
22+
if command -v sed > /dev/null; then
23+
sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /etc/shadow
24+
else
25+
while IFS=: read -r username password last_change min_age max_age warn inactive expire reserved; do
26+
echo "$username:$password::$min_age:$max_age:$warn:$inactive:$expire:$reserved" >> /etc/shadow.new
27+
done < /etc/shadow
28+
mv /etc/shadow.new /etc/shadow
29+
chmod 640 /etc/shadow
30+
fi
31+
32+
# remove logs and temporary files
33+
rm -vrf /var/log/alternatives.log
34+
rm -vrf /var/log/lastlog
35+
rm -vrf /var/log/tallylog
36+
rm -vrf /var/log/zypper.log
37+
rm -vrf /var/log/zypp/history
38+
rm -vrf /var/log/YaST2
39+
rm -vrf /var/lib/zypp/AnonymousUniqueId
40+
rm -vrf /var/cache/zypp/*
41+
rm -vrf /run/*
42+
rm -vrf /etc/shadow-
43+
rm -vrf /etc/group-
44+
rm -vrf /etc/passwd-
45+
rm -vrf /etc/.pwd.lock
46+
rm -vrf /usr/lib/sysimage/rpm/.rpm.lock
47+
rm -vrf /var/cache/ldconfig/aux-cache
48+
49+
50+
exit 0

bind-image/Dockerfile

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,28 @@ RUN set -euo pipefail; \
3636
cp /target//usr/libexec/bind/named.prep /target/usr/local/lib/bind/named.prep; \
3737
sed -i -e 's|logger "Warning: \$1"|echo "Warning: \$1" >\&2|' -e '/\. \$SYSCONFIG_FILE/d' /target/usr/local/lib/bind/named.prep
3838

39-
40-
# cleanup logs and temporary files
39+
# image cleanup
4140
RUN set -euo pipefail; zypper -n --installroot /target clean -a; \
42-
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}; \
43-
rm -rf {/target,}/run/*; \
44-
rm -f {/target,}/etc/{shadow-,group-,passwd-,.pwd.lock}; \
45-
rm -f {/target,}/usr/lib/sysimage/rpm/.rpm.lock; \
46-
rm -f {/target,}/var/cache/ldconfig/aux-cache; \
47-
command -v zypper >/dev/null 2>&1 || rm -f /var/lib/zypp/AutoInstalled
41+
rm -vrf /target/var/log/alternatives.log; \
42+
rm -vrf /target/var/log/lastlog; \
43+
rm -vrf /target/var/log/tallylog; \
44+
rm -vrf /target/var/log/zypper.log; \
45+
rm -vrf /target/var/log/zypp/history; \
46+
rm -vrf /target/var/log/YaST2; \
47+
rm -vrf /target/var/lib/zypp/AnonymousUniqueId; \
48+
rm -vrf /target/var/cache/zypp/*; \
49+
rm -vrf /target/run/*; \
50+
rm -vrf /target/etc/shadow-; \
51+
rm -vrf /target/etc/group-; \
52+
rm -vrf /target/etc/passwd-; \
53+
rm -vrf /target/etc/.pwd.lock; \
54+
rm -vrf /target/usr/lib/sysimage/rpm/.rpm.lock; \
55+
rm -vrf /target/var/cache/ldconfig/aux-cache; \
56+
rm -vrf /target/var/lib/zypp/AutoInstalled; \
57+
rm -vrf /target/usr/lib/sysimage/rpm/Index.db; \
58+
[ -f /var/lib/zypp/AutoInstalled ] && sed -i '1d' /var/lib/zypp/AutoInstalled; \
59+
sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /target/etc/shadow
4860

49-
# set the day of last password change to empty
50-
RUN set -euo pipefail; sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /target/etc/shadow
5161
FROM registry.suse.com/bci/bci-micro:16.0
5262
COPY --from=builder /target /
5363
# Define labels according to https://en.opensuse.org/Building_derived_containers

busybox-image/config.sh

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,5 @@ fi
1919

2020
sed -i 's|/bin/bash|/bin/sh|' /etc/passwd
2121

22-
# not making sense in a zypper-free image
23-
rm -vf /var/lib/zypp/AutoInstalled
24-
25-
# includes device and inode numbers that change on deploy
26-
rm -vf /var/cache/ldconfig/aux-cache
27-
28-
# Will be recreated by the next rpm(1) run as root user
29-
rm -vf /usr/lib/sysimage/rpm/Index.db
30-
31-
# set the day of last password change to empty
32-
sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /etc/shadow
33-
34-
35-
#=======================================
36-
# Clean up after zypper if it is present
37-
#---------------------------------------
38-
if command -v zypper > /dev/null; then
39-
zypper -n clean -a
40-
fi
41-
42-
#=============================================
43-
# Clean up logs and temporary files if present
44-
#---------------------------------------------
45-
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}; \
46-
rm -rf {/target,}/run/*; \
47-
rm -f {/target,}/etc/{shadow-,group-,passwd-,.pwd.lock}; \
48-
rm -f {/target,}/usr/lib/sysimage/rpm/.rpm.lock; \
49-
rm -f {/target,}/var/cache/ldconfig/aux-cache; \
50-
command -v zypper >/dev/null 2>&1 || rm -f /var/lib/zypp/AutoInstalled
51-
5222

5323
exit 0

busybox-image/images.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/sh
2+
# SPDX-License-Identifier: MIT
3+
# SPDX-FileCopyrightText: (c) 2022-2025 SUSE LLC
4+
5+
set -euo pipefail
6+
7+
#======================================
8+
# Image Cleanup
9+
#--------------------------------------
10+
if command -v zypper > /dev/null; then
11+
zypper -n clean -a
12+
# drop timestamp
13+
tail -n +2 /var/lib/zypp/AutoInstalled > /var/lib/zypp/AutoInstalled.new && mv /var/lib/zypp/AutoInstalled.new /var/lib/zypp/AutoInstalled
14+
else
15+
# it does not make sense in a zypper-free image
16+
rm -vrf /var/lib/zypp/AutoInstalled
17+
rm -vrf /usr/lib/sysimage/rpm/Index.db
18+
fi
19+
20+
# set the day of last password change to empty
21+
# prefer sed if available
22+
if command -v sed > /dev/null; then
23+
sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /etc/shadow
24+
else
25+
while IFS=: read -r username password last_change min_age max_age warn inactive expire reserved; do
26+
echo "$username:$password::$min_age:$max_age:$warn:$inactive:$expire:$reserved" >> /etc/shadow.new
27+
done < /etc/shadow
28+
mv /etc/shadow.new /etc/shadow
29+
chmod 640 /etc/shadow
30+
fi
31+
32+
# remove logs and temporary files
33+
rm -vrf /var/log/alternatives.log
34+
rm -vrf /var/log/lastlog
35+
rm -vrf /var/log/tallylog
36+
rm -vrf /var/log/zypper.log
37+
rm -vrf /var/log/zypp/history
38+
rm -vrf /var/log/YaST2
39+
rm -vrf /var/lib/zypp/AnonymousUniqueId
40+
rm -vrf /var/cache/zypp/*
41+
rm -vrf /run/*
42+
rm -vrf /etc/shadow-
43+
rm -vrf /etc/group-
44+
rm -vrf /etc/passwd-
45+
rm -vrf /etc/.pwd.lock
46+
rm -vrf /usr/lib/sysimage/rpm/.rpm.lock
47+
rm -vrf /var/cache/ldconfig/aux-cache
48+
49+
50+
exit 0

cdi-image/Dockerfile.apiserver

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,28 @@ RUN set -euo pipefail; \
3535
cut -d '.' -f -3)" = "1.60.1" ]
3636
RUN set -euo pipefail; useradd -u 1001 --create-home -s /bin/bash cdi-apiserver
3737

38-
39-
# cleanup logs and temporary files
38+
# image cleanup
4039
RUN set -euo pipefail; zypper -n --installroot /target clean -a; \
41-
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}; \
42-
rm -rf {/target,}/run/*; \
43-
rm -f {/target,}/etc/{shadow-,group-,passwd-,.pwd.lock}; \
44-
rm -f {/target,}/usr/lib/sysimage/rpm/.rpm.lock; \
45-
rm -f {/target,}/var/cache/ldconfig/aux-cache; \
46-
command -v zypper >/dev/null 2>&1 || rm -f /var/lib/zypp/AutoInstalled
40+
rm -vrf /target/var/log/alternatives.log; \
41+
rm -vrf /target/var/log/lastlog; \
42+
rm -vrf /target/var/log/tallylog; \
43+
rm -vrf /target/var/log/zypper.log; \
44+
rm -vrf /target/var/log/zypp/history; \
45+
rm -vrf /target/var/log/YaST2; \
46+
rm -vrf /target/var/lib/zypp/AnonymousUniqueId; \
47+
rm -vrf /target/var/cache/zypp/*; \
48+
rm -vrf /target/run/*; \
49+
rm -vrf /target/etc/shadow-; \
50+
rm -vrf /target/etc/group-; \
51+
rm -vrf /target/etc/passwd-; \
52+
rm -vrf /target/etc/.pwd.lock; \
53+
rm -vrf /target/usr/lib/sysimage/rpm/.rpm.lock; \
54+
rm -vrf /target/var/cache/ldconfig/aux-cache; \
55+
rm -vrf /target/var/lib/zypp/AutoInstalled; \
56+
rm -vrf /target/usr/lib/sysimage/rpm/Index.db; \
57+
[ -f /var/lib/zypp/AutoInstalled ] && sed -i '1d' /var/lib/zypp/AutoInstalled; \
58+
sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /target/etc/shadow
4759

48-
# set the day of last password change to empty
49-
RUN set -euo pipefail; sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /target/etc/shadow
5060
FROM registry.suse.com/bci/bci-micro:16.0
5161
COPY --from=builder /target /
5262
# Define labels according to https://en.opensuse.org/Building_derived_containers

cdi-image/Dockerfile.cloner

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,28 @@ RUN set -euo pipefail; \
3535
cut -d '.' -f -3)" = "1.60.1" ]
3636
RUN set -euo pipefail; useradd -u 1001 --create-home -s /bin/bash cdi-cloner
3737

38-
39-
# cleanup logs and temporary files
38+
# image cleanup
4039
RUN set -euo pipefail; zypper -n --installroot /target clean -a; \
41-
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}; \
42-
rm -rf {/target,}/run/*; \
43-
rm -f {/target,}/etc/{shadow-,group-,passwd-,.pwd.lock}; \
44-
rm -f {/target,}/usr/lib/sysimage/rpm/.rpm.lock; \
45-
rm -f {/target,}/var/cache/ldconfig/aux-cache; \
46-
command -v zypper >/dev/null 2>&1 || rm -f /var/lib/zypp/AutoInstalled
40+
rm -vrf /target/var/log/alternatives.log; \
41+
rm -vrf /target/var/log/lastlog; \
42+
rm -vrf /target/var/log/tallylog; \
43+
rm -vrf /target/var/log/zypper.log; \
44+
rm -vrf /target/var/log/zypp/history; \
45+
rm -vrf /target/var/log/YaST2; \
46+
rm -vrf /target/var/lib/zypp/AnonymousUniqueId; \
47+
rm -vrf /target/var/cache/zypp/*; \
48+
rm -vrf /target/run/*; \
49+
rm -vrf /target/etc/shadow-; \
50+
rm -vrf /target/etc/group-; \
51+
rm -vrf /target/etc/passwd-; \
52+
rm -vrf /target/etc/.pwd.lock; \
53+
rm -vrf /target/usr/lib/sysimage/rpm/.rpm.lock; \
54+
rm -vrf /target/var/cache/ldconfig/aux-cache; \
55+
rm -vrf /target/var/lib/zypp/AutoInstalled; \
56+
rm -vrf /target/usr/lib/sysimage/rpm/Index.db; \
57+
[ -f /var/lib/zypp/AutoInstalled ] && sed -i '1d' /var/lib/zypp/AutoInstalled; \
58+
sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /target/etc/shadow
4759

48-
# set the day of last password change to empty
49-
RUN set -euo pipefail; sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /target/etc/shadow
5060
FROM registry.suse.com/bci/bci-micro:16.0
5161
COPY --from=builder /target /
5262
# Define labels according to https://en.opensuse.org/Building_derived_containers

0 commit comments

Comments
 (0)