-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (45 loc) · 2.18 KB
/
Dockerfile
File metadata and controls
54 lines (45 loc) · 2.18 KB
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
44
45
46
47
48
49
50
51
52
53
54
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV GRADLE_VERSION=8.7
# Install dependencies and Python 3.7
RUN apt-get update && \
apt-get install -y software-properties-common curl wget unzip git build-essential \
ca-certificates gnupg openjdk-17-jdk libstdc++6 zlib1g libc6 && \
add-apt-repository ppa:deadsnakes/ppa -y && \
apt-get update && \
apt-get install -y python3.7 python3.7-venv python3.7-dev python3.7-distutils && \
wget -q https://bootstrap.pypa.io/pip/3.7/get-pip.py && \
python3.7 get-pip.py && \
python3.7 -m pip install --upgrade pip && \
python3.7 -m pip install --no-cache-dir google-api-python-client oauth2client && \
rm get-pip.py && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set Python 3.7 as default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1
# Install Node.js 18
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
# Install Gradle
RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -P /tmp && \
unzip -d /opt/gradle /tmp/gradle-${GRADLE_VERSION}-bin.zip && \
ln -s /opt/gradle/gradle-${GRADLE_VERSION}/bin/gradle /usr/bin/gradle && \
rm /tmp/gradle-${GRADLE_VERSION}-bin.zip
# Install Android SDK Command Line Tools
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && \
cd ${ANDROID_SDK_ROOT}/cmdline-tools && \
wget https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -O tools.zip && \
unzip tools.zip -d temp && \
rm tools.zip && \
mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools/latest && \
mv temp/cmdline-tools/* ${ANDROID_SDK_ROOT}/cmdline-tools/latest/
# Update PATH
ENV PATH="${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_SDK_ROOT}/build-tools/33.0.2:$PATH"
# Install Android SDK Packages
RUN yes | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --licenses && \
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager \
"platform-tools" "platforms;android-33" "build-tools;33.0.2"
WORKDIR /workspace
CMD ["/bin/bash"]