-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
43 lines (29 loc) · 1.53 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM openjdk:11-jdk
MAINTAINER Seanghay
WORKDIR /root
ENV ANDROID_COMPILE_SDK=30
ENV ANDROID_BUILD_TOOLS=30.0.3
ENV ANDROID_SDK_TOOLS=6858069_latest
# Install packages
RUN apt-get --quiet update --yes
RUN apt-get --quiet install --yes wget tar unzip lib32stdc++6
RUN apt-get -qq install curl jq
# Node.js
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get --quiet install nodejs --yes
RUN apt-get --quiet install gcc g++ make --yes
RUN wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}.zip
RUN mkdir -p android-sdk-linux/cmdline-tools
RUN unzip -d android-sdk-linux/cmdline-tools android-sdk.zip
# the folder should be `android-sdk-linux/cmdline-tools/tools`. (I have no idea why Google did this!)
RUN mv android-sdk-linux/cmdline-tools/cmdline-tools android-sdk-linux/cmdline-tools/tools
# Use `ANDROID_SDK_ROOT` instead of `ANDROID_HOME`. `ANDROID_HOME` is deprecated
ENV ANDROID_SDK_ROOT=/root/android-sdk-linux
RUN echo y | android-sdk-linux/cmdline-tools/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null
RUN echo y | android-sdk-linux/cmdline-tools/tools/bin/sdkmanager "platform-tools" >/dev/null
RUN echo y | android-sdk-linux/cmdline-tools/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null
ENV PATH=$PATH:/root/android-sdk-linux/platform-tools/
# Accept all licenses
RUN yes | android-sdk-linux/cmdline-tools/tools/bin/sdkmanager --licenses
# gradle cache directory
ENV GRADLE_USER_HOME=/root/.gradle