From b7314075e5d461cab46fcb7277eb0b448270477e Mon Sep 17 00:00:00 2001 From: mudler Date: Fri, 26 Jun 2015 13:47:17 +0200 Subject: [PATCH] [Dockerfile] adding execution of script/post-update, cleanup phase --- Dockerfile | 3 +++ script/post-update.sh | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 script/post-update.sh diff --git a/Dockerfile b/Dockerfile index b9e3a8b..c740034 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,3 +27,6 @@ RUN /bin/bash /sabayon-configuration-build.sh && rm -rf /sabayon-configuration-b # Perform before-upgrade tasks (mirror sorting, updating repository db, removing portage and keeping profiles and metadata) RUN mv /etc/entropy/repositories.conf.d/entropy_sabayonlinux.org.example /etc/entropy/repositories.conf.d/entropy_sabayonlinux.org && equo up && equo repo mirrorsort sabayonlinux.org && cd /usr/portage/;ls | grep -v 'profiles' | grep -v 'metadata' | xargs rm -rf +# Cleanup and applying configs +ADD ./script/post-update.sh /post-update.sh +RUN /bin/bash /post-update.sh && rm -rf /post-update.sh diff --git a/script/post-update.sh b/script/post-update.sh new file mode 100644 index 0000000..46f76b2 --- /dev/null +++ b/script/post-update.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Remove scripts +rm -rf /equo-rescue-generate.exp +rm -rf /equo.sql +rm -rf /generate-equo-db.sh +rm -rf /post-upgrade.sh +rm -rf /sabayon-configuration-build.sh +rm -rf /sabayon-configuration.sh +rm -rf /post-upgrade.sh + +# Cleaning portage metadata cache +rm -rf /usr/portage/metadata/md5-cache/* +rm -rf /var/log/emerge/* +rm -rf /var/log/entropy/* +rm -rf /root/* /root/.* +rm -rf /etc/zsh + +rm -rf /post-update.sh + +# Writing package list file +equo q list installed -qv > /etc/sabayon-pkglist