-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
34 lines (25 loc) · 938 Bytes
/
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
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
# https://developer.android.com/studio/index.html#command-tools
WORKDIR /opt/android
RUN apt-get update \
&& apt-get install -y \
curl \
unzip \
openjdk-8-jdk
# jdk 8, 11, 13 ,16
# && apt-get install -y android-sdk
ENV ANDROID_HOME=/opt/android
ENV PATH=$ANDROID_HOME/cmdline-tools/tools/bin/:$PATH
ENV PATH=$ANDROID_HOME/emulator/:$PATH
ENV PATH=$ANDROID_HOME/platform-tools/:$PATH
RUN curl -L $(curl -sL https://developer.android.com/studio/index.html\#command-tools | grep "zip" | grep "linux" | grep "commandline" | grep "href" | cut -d'"' -f2) -O \
&& unzip $(ls | grep zip) \
&& rm -rf $(ls | grep zip) \
&& mkdir tools \
&& mv cmdline-tools/* tools \
&& mv tools cmdline-tools/ \
&& yes | sdkmanager --licenses
# ENV GRADLE_OPTS=-Djava.io.tmpdir=/repo/
# export GRADLE_OPTS=-Djava.io.tmpdir=/repo/
# ./gradlew assemble