Skip to content

Commit

Permalink
Merge pull request #4 from matheus-souza/feature/add-android-sdk
Browse files Browse the repository at this point in the history
feat: add android tools and sdk
  • Loading branch information
matheus-souza committed May 11, 2022
2 parents ce1c73b + 48e873c commit 1ad829f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ignored:
- DL3008
- DL3028
- DL4006
trustedRegistries:
- docker.io
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,39 @@ RUN apt-get update -qq > /dev/null && \
RUN gem install bundler && \
gem install fastlane > /dev/null

ENV ANDROID_HOME="/opt/android-sdk"

ENV ANDROID_COMPILE_SDK="30" \
ANDROID_BUILD_TOOLS="30.0.3" \
ANDROID_SDK_TOOLS="8092744"

# Install Android SDK
RUN echo "sdk tools ${ANDROID_SDK_TOOLS}" && \
wget --quiet --output-document=sdk-tools.zip \
"https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip" && \
mkdir --parents "$ANDROID_HOME" && \
unzip -q sdk-tools.zip -d "$ANDROID_HOME" && \
rm --force sdk-tools.zip

# Install SDKs
# Please keep these in descending order!
# The `yes` is for accepting all non-standard tool licenses.
RUN mkdir --parents "$ANDROID_HOME/.android/" && \
(echo '### User Sources for Android SDK Manager' > \
"$ANDROID_HOME/.android/repositories.cfg" && \
(yes | ("$ANDROID_HOME"/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} --licenses || true)))

#
# https://developer.android.com/studio/command-line/sdkmanager.html
#
RUN echo "platforms" && \
"$ANDROID_HOME"/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} \
"platforms;android-${ANDROID_COMPILE_SDK}" > /dev/null

RUN echo "platform tools" && \
"$ANDROID_HOME"/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} \
"platform-tools" > /dev/null

RUN echo "build tools" && \
"$ANDROID_HOME"/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} \
"build-tools;${ANDROID_BUILD_TOOLS}" > /dev/null

0 comments on commit 1ad829f

Please sign in to comment.