diff --git a/scripts/Dockerfile b/scripts/Dockerfile index f4fe982ee..d8d74f824 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -26,11 +26,7 @@ RUN apt-get update && \ # Removed unused parts to make a smaller Docker image: apt-get remove -yq --autoremove lsb-release software-properties-common && \ apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ - cd /home/builder/lib/android-ndk/ && \ - rm -Rf sources/cxx-stl/system && \ - cd /home/builder/lib/android-sdk/tools && \ - rm -Rf emulator* lib* proguard templates + rm -rf /var/lib/apt/lists/* # Switch User USER builder:builder diff --git a/scripts/setup-android-sdk.sh b/scripts/setup-android-sdk.sh index 7a5010c7f..1ca88a35d 100755 --- a/scripts/setup-android-sdk.sh +++ b/scripts/setup-android-sdk.sh @@ -24,6 +24,9 @@ if [ ! -d $ANDROID_HOME ]; then $ANDROID_SDK_SHA256 rm -Rf android-sdk-$TERMUX_SDK_REVISION unzip -q tools-$TERMUX_SDK_REVISION.zip -d android-sdk-$TERMUX_SDK_REVISION + + # Remove unused parts + rm -Rf android-sdk-$TERMUX_SDK_REVISION/{emulator*,lib*,proguard,templates} fi if [ ! -d $NDK ]; then @@ -36,6 +39,9 @@ if [ ! -d $NDK ]; then $ANDROID_NDK_SHA256 rm -Rf android-ndk-r$TERMUX_NDK_VERSION unzip -q ndk-r${TERMUX_NDK_VERSION}.zip + + # Remove unused parts + rm -Rf android-ndk-r$TERMUX_NDK_VERSION/sources/cxx-stl/system fi yes | $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_HOME --licenses