Skip to content

Commit

Permalink
Update image to support Android SDK 30
Browse files Browse the repository at this point in the history
  • Loading branch information
randr0id committed Dec 18, 2020
1 parent c5abf17 commit 655e9a2
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 37 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
*/
!utils/
!packages.txt
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Mac Files
.DS_Store

2 changes: 2 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ignored:
- DL3008
- DL4006
- SC2086
- SC2154
62 changes: 31 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
limitations under the License.
8 changes: 4 additions & 4 deletions packages.txt
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 655e9a2

Please sign in to comment.