forked from appventure-nush/builder-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
64 lines (52 loc) · 1.73 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Android Dockerfile based on uber/android-build-environment
FROM ubuntu:18.04
# SDK version
ENV ANDROID_SDK_VERSION 6858069
ENV PLATFORM_VERSION 29
ENV BUILD_TOOLS_VERSION 29.0.3
# Never ask for confirmations
ENV DEBIAN_FRONTEND noninteractive
# Update apt-get
RUN apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends \
software-properties-common \
unzip \
wget \
zip \
xxd \
&& apt-add-repository ppa:openjdk-r/ppa \
&& apt-get -qq update \
&& apt-get -qq install -y openjdk-8-jdk \
-o Dpkg::Options::="--force-overwrite" \
&& apt-get -qq autoremove -y \
&& apt-get -qq clean \
&& rm -rf /var/lib/apt/lists/*
# Install Android SDK
RUN wget https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip -q \
&& mkdir /usr/local/android \
&& unzip -q commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip -d /usr/local/android \
&& rm commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip
# Export JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
# Environment variables
ENV ANDROID_HOME /usr/local/android
ENV ANDROID_SDK_HOME $ANDROID_HOME
ENV ANDROID_NDK_HOME $ANDROID_HOME/ndk-bundle
ENV PATH $ANDROID_HOME/tools/bin:$ANDROID_HOME/build-tools/$BUILD_TOOLS_VERSION:$PATH
# Install Android SDK components
RUN echo "y" | sdkmanager \
# "ndk-bundle" \
# "lldb;2.3" \
# "cmake;3.6.4111459" \
"extras;google;m2repository" \
"platform-tools" \
"platforms;android-$PLATFORM_VERSION" \
"build-tools;$BUILD_TOOLS_VERSION"
# Add release helper
COPY release /usr/local/bin/release
# Build directory
ENV SRC /src
RUN mkdir $SRC
WORKDIR $SRC
RUN echo "sdk.dir=$ANDROID_HOME" > local.properties
CMD ["./gradlew", "build"]