build: update android sdk (use api 30)

This commit is contained in:
Jovan Krunić
2021-02-05 20:46:26 +01:00
parent 7b767001ad
commit b4bed4e834

View File

@@ -6,23 +6,24 @@ LABEL version="2.0.0" \
maintainer="Jovan Krunić <krunic@uni-frankfurt.de>" maintainer="Jovan Krunić <krunic@uni-frankfurt.de>"
### Configure versions to install ### Configure versions to install
ENV ANDROID_APIS="android-26" \ ENV ANDROID_APIS="android-30" \
ANDROID_BUILD_TOOLS_VERSION="26.0.2" \ ANDROID_BUILD_TOOLS_VERSION="30.0.2" \
NPM_VERSION="latest" \ NPM_VERSION="latest" \
IONIC_VERSION="^6.0.0" \ IONIC_VERSION="^6.0.0" \
CORDOVA_VERSION="^9.0.0" \ CORDOVA_VERSION="^9.0.0" \
### Configure download URLs ### Configure download URLs
ANDROID_SDK_TOOLS_DOWNLOAD_URL="https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip" \ ANDROID_SDK_TOOLS_DOWNLOAD_URL="https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip" \
GOOGLE_SIGNING_KEY_URL="https://dl-ssl.google.com/linux/linux_signing_key.pub" \ GOOGLE_SIGNING_KEY_URL="https://dl-ssl.google.com/linux/linux_signing_key.pub" \
GOOGLE_CHROME_REPOSITORY_URL="http://dl.google.com/linux/chrome/deb/" \ GOOGLE_CHROME_REPOSITORY_URL="http://dl.google.com/linux/chrome/deb/" \
### Android SDK path ### Android SDK path
ANDROID_HOME="/opt/android-sdk" \ ANDROID_SDK_ROOT="/opt/android-sdk" \
### Installation files ### Installation files
SCRIPTS_DIRECTORY="scripts" \ SCRIPTS_DIRECTORY="scripts" \
NODE_SETUP_SCRIPT="node_setup.sh" NODE_SETUP_SCRIPT="node_setup.sh"
### Set $PATH ### Set $PATH
ENV PATH=$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH #ENV PATH=$ANDROID_SDK_ROOT/cmdline-tools/:$ANDROID_SDK_ROOT/cmdline-tools/bin:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
ENV PATH=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$ANDROID_SDK_ROOT/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
### Replace shell with bash ### Replace shell with bash
RUN rm /bin/sh && ln -s /bin/bash /bin/sh && \ RUN rm /bin/sh && ln -s /bin/bash /bin/sh && \
@@ -74,15 +75,15 @@ RUN apt-get update -y && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
### Workaround to fix cacerts problem (Ubuntu): ### Workaround to fix cacerts problem (Ubuntu):
### https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty) ### https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty
RUN rm /etc/ssl/certs/java/cacerts && \ RUN rm /etc/ssl/certs/java/cacerts && \
update-ca-certificates -f update-ca-certificates -f
### Install android ### Install android
RUN curl $ANDROID_SDK_TOOLS_DOWNLOAD_URL > /tmp/android-sdk.zip && \ RUN curl $ANDROID_SDK_TOOLS_DOWNLOAD_URL > /tmp/android-sdk.zip && \
unzip /tmp/android-sdk.zip && \ unzip /tmp/android-sdk.zip && \
mkdir -p $ANDROID_HOME && \ mkdir -p $ANDROID_SDK_ROOT/cmdline-tools && \
mv tools $ANDROID_HOME && \ mv cmdline-tools $ANDROID_SDK_ROOT/cmdline-tools/tools && \
### Add licences (for "auto-accept licenses") ### Add licences (for "auto-accept licenses")
yes | sdkmanager --licenses && \ yes | sdkmanager --licenses && \
### Install platform tools ### Install platform tools