Skip to content

Commit c0656cc

Browse files
dockerfile: Fix bootc container lint for centos
Remove `/var/cache`, `/var/log` and other artifacts generated by rpm install Also enable EPEL for sbsigntools for centos Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1 parent 814233c commit c0656cc

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ RUN --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp \
6868

6969
pkgs_to_install=()
7070
if [[ "${seal_state}" == "sealed" ]]; then
71+
. /usr/lib/os-release
72+
case "${ID}${ID_LIKE:-}" in
73+
*centos*|*rhel*)
74+
# Enable EPEL for sbsigntools
75+
dnf -y install epel-release
76+
;;
77+
esac
7178
pkgs_to_install+=(sbsigntools)
7279
fi
7380

@@ -204,6 +211,12 @@ if [[ "${boot_type}" == "uki" ]]; then
204211
cp /run/packaging/initialize-sealing-tools /usr/bin/initialize-sealing-tools
205212
fi
206213

214+
# Fix linting for centos
215+
rm -rf /var/log
216+
rm -rf /var/lib
217+
rm -rf /var/cache
218+
rm -rf /run/rhsm
219+
207220
EORUN
208221
# Configure the rootfs
209222
ARG rootfs=""

0 commit comments

Comments
 (0)