-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (40 loc) · 1.79 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
44
45
46
47
48
49
50
# syntax=docker/dockerfile:1
FROM debian:stable
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Install system commands, Android SDK, and Ruby
RUN apt-get update \
&& apt-get install -y coreutils git wget locales android-sdk android-sdk-build-tools \
&& apt-get -y autoclean
# Set up the default locale
RUN locale-gen en_US.UTF-8
ENV LANG="en_US.UTF-8" LANGUAGE="en_US:en"
ENV ANDROID_HOME=/usr/lib/android-sdk
ENV GRADLE_OPTS="-Xmx6G -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false"
# Download the SDK Manager
RUN wget https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip \
&& unzip commandlinetools-linux-6858069_latest.zip && rm commandlinetools-linux-6858069_latest.zip \
&& mkdir /usr/lib/android-sdk/cmdline-tools \
&& mv cmdline-tools /usr/lib/android-sdk/cmdline-tools/latest
ENV PATH="//usr/lib/android-sdk/cmdline-tools/latest/bin:${PATH}"
RUN yes | sdkmanager --licenses
# Uninstall '29.0.3' so that the builds won't complain about it being installed in incorrect location
RUN sdkmanager --uninstall "build-tools;29.0.3"
RUN sdkmanager --install \
"build-tools;33.0.2" \
"build-tools;34.0.0" \
"platform-tools" \
"platforms;android-33" \
"platforms;android-34"
RUN mkdir scripts
COPY scripts/ scripts/
ENV PATH="/scripts/:${PATH}"
# Cache Gradle 8.2.1
RUN mkdir gradle-cache-tmp \
&& cd gradle-cache-tmp \
&& wget https://services.gradle.org/distributions/gradle-8.2.1-bin.zip \
&& unzip gradle-8.2.1-bin.zip \
&& touch settings.gradle \
&& gradle-8.2.1/bin/gradle wrapper --gradle-version 8.2.1 --distribution-type all \
&& ./gradlew \
&& cd .. \
&& rm -rf ./gradle-cache-tmp \