@@ -20,10 +20,14 @@ FROM ubuntu:18.04
20
20
ENV ANDROID_HOME="/opt/android"
21
21
22
22
RUN apt -y update -qq \
23
- && apt -y install -qq --no-install-recommends curl unzip \
24
- && apt -y autoremove \
25
- && apt -y clean
23
+ && apt -y install -qq --no-install-recommends curl unzip ca-certificates \
24
+ && apt -y autoremove
26
25
26
+ # retry helper script, refs:
27
+ # https://github.com/kivy/python-for-android/issues/1306
28
+ ENV RETRY="retry -t 3 --"
29
+ RUN curl https://raw.githubusercontent.com/kadwanev/retry/1.0.1/retry \
30
+ --output /usr/local/bin/retry && chmod +x /usr/local/bin/retry
27
31
28
32
ENV ANDROID_NDK_HOME="${ANDROID_HOME}/android-ndk"
29
33
ENV ANDROID_NDK_VERSION="17c"
@@ -34,7 +38,7 @@ ENV ANDROID_NDK_ARCHIVE="android-ndk-r${ANDROID_NDK_VERSION}-linux-x86_64.zip"
34
38
ENV ANDROID_NDK_DL_URL="https://dl.google.com/android/repository/${ANDROID_NDK_ARCHIVE}"
35
39
36
40
# download and install Android NDK
37
- RUN curl --location --progress-bar --insecure \
41
+ RUN ${RETRY} curl --location --progress-bar --insecure \
38
42
"${ANDROID_NDK_DL_URL}" \
39
43
--output "${ANDROID_NDK_ARCHIVE}" \
40
44
&& mkdir --parents "${ANDROID_NDK_HOME_V}" \
@@ -52,7 +56,7 @@ ENV ANDROID_SDK_TOOLS_ARCHIVE="sdk-tools-linux-${ANDROID_SDK_TOOLS_VERSION}.zip"
52
56
ENV ANDROID_SDK_TOOLS_DL_URL="https://dl.google.com/android/repository/${ANDROID_SDK_TOOLS_ARCHIVE}"
53
57
54
58
# download and install Android SDK
55
- RUN curl --location --progress-bar --insecure \
59
+ RUN ${RETRY} curl --location --progress-bar --insecure \
56
60
"${ANDROID_SDK_TOOLS_DL_URL}" \
57
61
--output "${ANDROID_SDK_TOOLS_ARCHIVE}" \
58
62
&& mkdir --parents "${ANDROID_SDK_HOME}" \
@@ -65,10 +69,8 @@ RUN mkdir --parents "${ANDROID_SDK_HOME}/.android/" \
65
69
> "${ANDROID_SDK_HOME}/.android/repositories.cfg"
66
70
67
71
# accept Android licenses (JDK necessary!)
68
- RUN apt -y update -qq \
69
- && apt -y install -qq --no-install-recommends openjdk-8-jdk \
70
- && apt -y autoremove \
71
- && apt -y clean
72
+ RUN ${RETRY} apt -y install -qq --no-install-recommends openjdk-8-jdk \
73
+ && apt -y autoremove
72
74
RUN yes | "${ANDROID_SDK_HOME}/tools/bin/sdkmanager" "build-tools;${ANDROID_SDK_BUILD_TOOLS_VERSION}" > /dev/null
73
75
74
76
# download platforms, API, build tools
@@ -84,27 +86,23 @@ ENV WORK_DIR="${HOME_DIR}" \
84
86
PATH="${HOME_DIR}/.local/bin:${PATH}"
85
87
86
88
# install system dependencies
87
- RUN apt -y update -qq \
88
- && apt -y install -qq --no-install-recommends \
89
+ RUN ${RETRY} apt -y install -qq --no-install-recommends \
89
90
python virtualenv python-pip wget lbzip2 patch sudo \
90
- && apt -y autoremove \
91
- && apt -y clean
91
+ && apt -y autoremove
92
92
93
93
# build dependencies
94
94
# https://buildozer.readthedocs.io/en/latest/installation.html#android-on-ubuntu-16-04-64bit
95
95
RUN dpkg --add-architecture i386 \
96
- && apt -y update -qq \
97
- && apt -y install -qq --no-install-recommends \
96
+ && ${RETRY} apt -y update -qq \
97
+ && ${RETRY} apt -y install -qq --no-install-recommends \
98
98
build-essential ccache git python2.7 python2.7-dev \
99
99
libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 \
100
100
libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 \
101
101
zip zlib1g-dev zlib1g:i386 \
102
- && apt -y autoremove \
103
- && apt -y clean
102
+ && apt -y autoremove
104
103
105
104
# specific recipes dependencies (e.g. libffi requires autoreconf binary)
106
- RUN apt -y update -qq \
107
- && apt -y install -qq --no-install-recommends \
105
+ RUN ${RETRY} apt -y install -qq --no-install-recommends \
108
106
libffi-dev autoconf automake cmake gettext libltdl-dev libtool pkg-config \
109
107
&& apt -y autoremove \
110
108
&& apt -y clean
0 commit comments