From 655e9a221becd59ff2a8bca13e3979cfc6f59f8a Mon Sep 17 00:00:00 2001 From: Randy Webster Date: Fri, 18 Dec 2020 10:53:10 -0800 Subject: [PATCH] Update image to support Android SDK 30 --- .dockerignore | 4 ++ .gitignore | 3 + .hadolint.yaml | 2 + Dockerfile | 62 +++++++++---------- README.md | 4 +- packages.txt | 8 +-- .../install-android-sdk.sh | 0 .../install-google-cloud-sdk.sh | 0 .../start-test-emulator.sh | 0 .../wait-for-emulator.sh | 0 10 files changed, 46 insertions(+), 37 deletions(-) create mode 100644 .dockerignore create mode 100644 .gitignore rename install-android-sdk.sh => utils/install-android-sdk.sh (100%) rename install-google-cloud-sdk.sh => utils/install-google-cloud-sdk.sh (100%) rename start-test-emulator.sh => utils/start-test-emulator.sh (100%) rename wait-for-emulator.sh => utils/wait-for-emulator.sh (100%) diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..886e13f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +* +*/ +!utils/ +!packages.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..86afa96 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Mac Files +.DS_Store + diff --git a/.hadolint.yaml b/.hadolint.yaml index 1fae47e..0b1880b 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -1,3 +1,5 @@ ignored: - DL3008 + - DL4006 + - SC2086 - SC2154 diff --git a/Dockerfile b/Dockerfile index 86965a6..97f35b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,53 +20,53 @@ LABEL org.label-schema.url="https://hub.docker.com/r/randr0id/android-docker" LABEL org.label-schema.vcs-url="https://github.com/randr0id/android-docker" LABEL org.label-schema.vcs-ref=${VCS_REF} -ENV VERSION_SDK_TOOLS "4333796" +ENV VERSION_TOOLS "6858069" ENV ANDROID_HOME "/sdk" ENV PATH "${PATH}:${ANDROID_HOME}/tools" ENV DEBIAN_FRONTEND noninteractive -RUN apt -qq update && \ - apt install -qqy --no-install-recommends \ - build-essential \ - bzip2 \ - curl \ - git-core \ - html2text \ - libc6-i386 \ - lib32stdc++6 \ - lib32gcc1 \ - lib32ncurses5 \ - lib32z1 \ - openjdk-8-jdk \ - qemu-kvm \ - unzip \ +RUN apt-get -qq update && \ + apt-get install -qqy --no-install-recommends \ + build-essential=12.4ubuntu1 \ + bzip2=1.0.6-8.1ubuntu0.2 \ + curl=7.58.0-2ubuntu3.12 \ + git=1:2.17.1-1ubuntu0.7 \ + html2text=1.3.2a-21 \ + libc6-i386=2.27-3ubuntu1.4 \ + lib32stdc++6=8.4.0-1ubuntu1~18.04 \ + lib32gcc1=1:8.4.0-1ubuntu1~18.04 \ + lib32ncurses5=6.1-1ubuntu1.18.04 \ + lib32z1=1:1.2.11.dfsg-0ubuntu2 \ + openjdk-8-jdk=8u275-b01-0ubuntu1~18.04 \ + qemu-kvm=1:2.11+dfsg-1ubuntu7.34 \ + unzip=6.0-21ubuntu1.1 \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN rm -f /etc/ssl/certs/java/cacerts; \ /var/lib/dpkg/info/ca-certificates-java.postinst configure -RUN curl -s "https://dl.google.com/android/repository/sdk-tools-linux-${VERSION_SDK_TOOLS}.zip" > /sdk.zip && \ - unzip /sdk.zip -d ${ANDROID_HOME} && \ - rm -v /sdk.zip +RUN curl -s https://dl.google.com/android/repository/commandlinetools-linux-${VERSION_TOOLS}_latest.zip > /tools.zip && \ + unzip /tools.zip -d ${ANDROID_HOME} && \ + mv ${ANDROID_HOME}/cmdline-tools ${ANDROID_HOME}/tools && \ + rm -v /tools.zip -RUN mkdir -p "${ANDROID_HOME}/licenses/" && \ - printf "8933bad161af4178b1185d1a37fbf41ea5269c55\\nd56f5187479451eabf01fb78af6dfcb131a6481e" > "${ANDROID_HOME}/licenses/android-sdk-license" && \ - printf "84831b9409646a918e30573bab4c9c91346d8abd\\n504667f4c0de7af1a06de9f4b1727b84351f2910" > "${ANDROID_HOME}/licenses/android-sdk-preview-license" +RUN mkdir -p ${ANDROID_HOME}/licenses/ && \ + printf "8933bad161af4178b1185d1a37fbf41ea5269c55\\nd56f5187479451eabf01fb78af6dfcb131a6481e\\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > ${ANDROID_HOME}/licenses/android-sdk-license && \ + printf "84831b9409646a918e30573bab4c9c91346d8abd\\n504667f4c0de7af1a06de9f4b1727b84351f2910" > ${ANDROID_HOME}/licenses/android-sdk-preview-license + +RUN yes | ${ANDROID_HOME}/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} --licenses RUN mkdir -p /root/.android && \ touch /root/.android/repositories.cfg && \ - "${ANDROID_HOME}/tools/bin/sdkmanager" --update + ${ANDROID_HOME}/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} --update -COPY packages.txt /sdk +COPY packages.txt ${ANDROID_HOME} RUN while read -r package; do PACKAGES="${PACKAGES}${package} "; done < /sdk/packages.txt && \ - "${ANDROID_HOME}/tools/bin/sdkmanager" ${PACKAGES} + ${ANDROID_HOME}/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} ${PACKAGES} -RUN yes | "${ANDROID_HOME}/tools/bin/sdkmanager" --licenses +COPY utils ${ANDROID_HOME}/utils -RUN mkdir /utils -COPY install-google-cloud-sdk.sh /utils -COPY start-test-emulator.sh /utils -COPY wait-for-emulator.sh /utils +RUN chmod +070 ${ANDROID_HOME} -CMD "${ANDROID_HOME}/tools/bin/sdkmanager" --update +WORKDIR /work diff --git a/README.md b/README.md index 695afb7..9db85a4 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Builds are available at Docker Hub: [https://hub.docker.com/r/randr0id/android-d ## License - Copyright 2018 Randy Webster. All rights reserved. + Copyright 2021 Randy Webster. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,4 +21,4 @@ Builds are available at Docker Hub: [https://hub.docker.com/r/randr0id/android-d distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + limitations under the License. diff --git a/packages.txt b/packages.txt index 0d52b4a..a977b89 100644 --- a/packages.txt +++ b/packages.txt @@ -1,6 +1,6 @@ add-ons;addon-google_apis-google-24 -build-tools;27.0.3 -build-tools;28.0.3 +build-tools;29.0.3 +build-tools;30.0.3 platform-tools -platforms;android-27 -platforms;android-28 +platforms;android-29 +platforms;android-30 diff --git a/install-android-sdk.sh b/utils/install-android-sdk.sh similarity index 100% rename from install-android-sdk.sh rename to utils/install-android-sdk.sh diff --git a/install-google-cloud-sdk.sh b/utils/install-google-cloud-sdk.sh similarity index 100% rename from install-google-cloud-sdk.sh rename to utils/install-google-cloud-sdk.sh diff --git a/start-test-emulator.sh b/utils/start-test-emulator.sh similarity index 100% rename from start-test-emulator.sh rename to utils/start-test-emulator.sh diff --git a/wait-for-emulator.sh b/utils/wait-for-emulator.sh similarity index 100% rename from wait-for-emulator.sh rename to utils/wait-for-emulator.sh