Skip to content

Commit

Permalink
Remove unneeded packages from final collector image (#1864)
Browse files Browse the repository at this point in the history
  • Loading branch information
Molter73 authored Oct 1, 2024
1 parent b346e7a commit 8b2d4e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion collector/container/devel/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -eo pipefail

dnf upgrade -y
dnf install -y kmod libasan elfutils-libelf
dnf install -y libasan elfutils-libelf
3 changes: 1 addition & 2 deletions collector/container/konflux.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,13 @@ COPY ./.konflux /tmp/.konflux
RUN /tmp/.konflux/scripts/subscription-manager-bro.sh register /mnt && \
dnf -y --installroot=/mnt upgrade --nobest && \
dnf -y --installroot=/mnt install --nobest \
kmod \
tbb \
jq \
c-ares && \
/tmp/.konflux/scripts/subscription-manager-bro.sh cleanup && \
# We can do usual cleanup while we're here: remove packages that would trigger violations. \
dnf -y --installroot=/mnt clean all && \
rpm --root=/mnt --verbose -e --nodeps $(rpm --root=/mnt -qa 'curl' '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*') && \
rpm --root=/mnt --verbose -e --nodeps $(rpm --root=/mnt -qa 'curl' '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*' 'libyaml*' 'libarchive*') && \
rm -rf /mnt/var/cache/dnf /mnt/var/cache/yum


Expand Down
7 changes: 5 additions & 2 deletions collector/container/rhel/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ set -eo pipefail

# UBI 9 requires confirmation with -y flag.
microdnf upgrade -y --nobest
microdnf install -y kmod findutils elfutils-libelf
microdnf install -y elfutils-libelf

microdnf clean all
rpm --query --all 'curl' '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*' 'findutils' | xargs -t rpm -e --nodeps
# shellcheck disable=SC2046
rpm --verbose -e --nodeps $(
rpm -qa 'curl' '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*' 'libyaml*' 'libarchive*'
)
rm -rf /var/cache/yum

0 comments on commit 8b2d4e6

Please sign in to comment.