Skip to content

Commit

Permalink
ci(docker-build): add more image clean up steps to layers
Browse files Browse the repository at this point in the history
  • Loading branch information
vpayno committed Aug 31, 2023
1 parent ac8fb16 commit 252e150
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/docker/include
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ layer_begin() {
cat /etc/ci-image-info
printf "\n"

echo apt update
echo Running: apt update
apt update || exit
printf "\n"

echo apt list --upgradable
echo Running: apt list --upgradable
apt list --upgradable || exit
printf "\n"

echo apt upgrade -y
echo Running: apt upgrade -y
apt upgrade -y || exit
printf "\n"

Expand All @@ -32,11 +32,19 @@ layer_begin() {
layer_end() {
printf "=== %s:%s start ===\n\n" "${0}" "layer_end()"

echo apt-get clean
apt-get clean || exit
echo Running: apt autoremove -y
apt autoremove -y || exit
printf "\n"

echo rm -rf /var/lib/apt/lists/*
echo Running: apt autoclean -y
apt autoclean -y || exit
printf "\n"

echo Running: apt-get clean -y
apt-get clean -y || exit
printf "\n"

echo Running: rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/* || exit
printf "\n"

Expand Down
13 changes: 13 additions & 0 deletions .github/docker/layer-00.00-base-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ main() {
apt list --installed >/root/apt-pkgs-start.txt
printf "\n"

echo Running: apt remove -y "$(apt list --installed | grep -e xorg -e xserver -e qt | cut -f1 -d/)"
# shellcheck disable=SC2046
apt remove -y $(apt list --installed | grep -e xorg -e xserver -e qt | cut -f1 -d/) || exit
printf "\n"

echo Running: apt-get purge libx11.* libqt.*
apt-get purge libx11.* libqt.* || exit
printf "\n"

echo Running: apt-get remove -y x11-common
apt-get remove -y x11-common || exit
printf "\n"

echo apt install -y "${PACKAGES}"
# shellcheck disable=SC2086
apt install -y ${PACKAGES} || exit
Expand Down

0 comments on commit 252e150

Please sign in to comment.