diff --git a/build_container/Dockerfile-ubuntu b/build_container/Dockerfile-ubuntu index bfdcd1c8..58877d07 100644 --- a/build_container/Dockerfile-ubuntu +++ b/build_container/Dockerfile-ubuntu @@ -6,9 +6,12 @@ ENV CLOUDSDK_PYTHON=python3 COPY ./build_container_common.sh / COPY ./build_container_ubuntu.sh / -RUN ./build_container_ubuntu.sh - -ENV LANG en_US.utf8 +ENV ANDROID_SDK_INSTALL_TARGET /.android ENV ANDROID_HOME /.android/sdk ENV ANDROID_SDK_ROOT /.android/sdk +ENV ANDROID_NDK_VERSION 21.4.7075529 ENV ANDROID_NDK_HOME /.android/sdk/ndk/21.4.7075529 + +RUN ./build_container_ubuntu.sh + +ENV LANG en_US.utf8 diff --git a/build_container/build_container_ubuntu.sh b/build_container/build_container_ubuntu.sh index 6c0719b1..ee5bea76 100755 --- a/build_container/build_container_ubuntu.sh +++ b/build_container/build_container_ubuntu.sh @@ -156,10 +156,8 @@ function install_android_tools() { # Install Android tools ####################### - sdk_install_target="/.android" - android_home="$sdk_install_target/sdk" - mkdir -p "$android_home" - pushd "$sdk_install_target" + mkdir -p "$ANDROID_HOME" + pushd "$ANDROID_SDK_INSTALL_TARGET" cmdline_file="commandlinetools-linux-7583922_latest.zip" curl -OL "https://dl.google.com/android/repository/$cmdline_file" @@ -167,8 +165,8 @@ function install_android_tools() { mkdir -p sdk/cmdline-tools/latest mv cmdline-tools/* sdk/cmdline-tools/latest - sdkmanager=$android_home/cmdline-tools/latest/bin/sdkmanager - echo "y" | $sdkmanager --install "ndk;21.4.7075529" + sdkmanager=$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager + echo "y" | $sdkmanager --install "ndk;$ANDROID_NDK_VERSION" $sdkmanager --install "platforms;android-30" $sdkmanager --install "build-tools;30.0.2"