forked from unitedclassifiedsapps/gitlab-ci-android-fastlane
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
63 lines (47 loc) · 2.02 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
FROM phusion/baseimage:0.11
LABEL maintainer="Jainam Jhaveri <engineerjainam@gmail.com>"
CMD ["/sbin/my_init"]
ENV LC_ALL "en_US.UTF-8"
ENV LANGUAGE "en_US.UTF-8"
ENV LANG "en_US.UTF-8"
ENV VERSION_SDK_TOOLS "7302050_latest"
ENV VERSION_BUILD_TOOLS "30.0.3"
ENV VERSION_TARGET_SDK "30"
ENV ANDROID_SDK_ROOT "/opt/android-sdk-linux"
ENV PATH "${PATH}:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin"
ENV DEBIAN_FRONTEND noninteractive
ENV HOME "/root"
RUN apt-add-repository ppa:brightbox/ruby-ng
RUN apt-get update
RUN apt-get -y install --no-install-recommends \
curl \
openjdk-8-jdk \
unzip \
zip \
git \
ruby \
ruby-dev \
build-essential \
file \
ssh \
wget
# ------------------------------------------------------
# --- Download Android Command line Tools into $ANDROID_SDK_ROOT
RUN cd /opt \
&& wget -q https://dl.google.com/android/repository/commandlinetools-linux-${VERSION_SDK_TOOLS}.zip -O android-commandline-tools.zip \
&& mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools \
&& unzip -q android-commandline-tools.zip -d /tmp/ \
&& mv /tmp/cmdline-tools/ ${ANDROID_SDK_ROOT}/cmdline-tools/latest \
&& rm android-commandline-tools.zip && ls -la ${ANDROID_SDK_ROOT}/cmdline-tools/latest/
ADD https://dl.google.com/android/repository/commandlinetools-linux-${VERSION_SDK_TOOLS}.zip /tools.zip
RUN unzip /tools.zip -d /sdk && rm -rf /tools.zip
RUN yes | sdkmanager --licenses
RUN mkdir -p $HOME/.android && touch $HOME/.android/repositories.cfg
RUN yes | sdkmanager "platform-tools" "tools" "platforms;android-${VERSION_TARGET_SDK}" "build-tools;${VERSION_BUILD_TOOLS}"
RUN yes | sdkmanager "extras;android;m2repository" "extras;google;google_play_services" "extras;google;m2repository"
RUN gem install fastlane --no-document && fastlane --version
ADD id_rsa $HOME/.ssh/id_rsa
ADD id_rsa.pub $HOME/.ssh/id_rsa.pub
ADD adbkey $HOME/.android/adbkey
ADD adbkey.pub $HOME/.android/adbkey.pub
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*