-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·62 lines (50 loc) · 2.16 KB
/
Dockerfile
File metadata and controls
executable file
·62 lines (50 loc) · 2.16 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
55
56
57
58
59
60
61
62
# docker build --rm --tag andbuild .
# docker run --rm -v "{PROJ_PATH}":/proj/ --workdir="/proj/" andbuild /bin/sh -c "./gradlew clean assembleDebug"
# docker run -it --rm -v {GRADLE_CACHE}:/root/.gradle/ -v "{PROJ_PATH}":/proj/ --workdir="/proj/" --entrypoint /bin/bash andbuild
FROM debian:stretch
MAINTAINER Bohdan Trofymchuk "bohdan.trofymchuk@gmail.com"
ENV VERSION_BUILD_TOOLS "29.0.3"
ENV VERSION_TARGET_SDK "29"
# Install Deps
RUN apt-get --quiet update --yes
RUN apt-get --quiet install --yes apt-utils wget tar git unzip lib32stdc++6 lib32z1 rsync nano openjdk-8-jdk
# Install Android SDK
RUN cd /opt && \
wget --output-document=android-sdk.zip --quiet https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip && \
unzip android-sdk.zip -d android-sdk-linux && \
rm -f android-sdk.zip && chown -R root.root android-sdk-linux
# Setup environment
ENV ANDROID_HOME /opt/android-sdk-linux
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
RUN mkdir -p $ANDROID_HOME/licenses/ \
&& echo "8933bad161af4178b1185d1a37fbf41ea5269c55" > $ANDROID_HOME/licenses/android-sdk-license \
&& echo "84831b9409646a918e30573bab4c9c91346d8abd" > $ANDROID_HOME/licenses/android-sdk-preview-license
RUN mkdir /root/.android
RUN touch /root/.android/repositories.cfg
# Install sdk elements
RUN (while [ 1 ]; do sleep 5; echo y; done) | ${ANDROID_HOME}/tools/bin/sdkmanager \
"platform-tools" \
"platforms;android-${VERSION_TARGET_SDK}" \
"platforms;android-28" \
"platforms;android-27" \
"platforms;android-26" \
"build-tools;${VERSION_BUILD_TOOLS}" \
"extras;google;m2repository" "extras;google;google_play_services" "patcher;v4" --verbose
#install gradle
RUN cd /opt \
&& wget --quiet --output-document=gradle.zip https://services.gradle.org/distributions/gradle-6.1.1-all.zip \
&& unzip -q gradle.zip && rm -f gradle.zip && chown -R root.root /opt/gradle-6.1.1/bin
ENV PATH ${PATH}:/opt/gradle-6.1.1/bin
ENV HOME /root
RUN which java
RUN which android
RUN which git
RUN which gradle
RUN which adb
# Cleaning
RUN apt-get clean
# GO to workspace
RUN mkdir -p /opt/workspace
VOLUME /root/.gradle
WORKDIR /opt/workspace
COPY .bashrc /root/.bashrc