forked from a12e/docker-qt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
5.13-android_x86_64.Dockerfile
102 lines (89 loc) · 3.34 KB
/
5.13-android_x86_64.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Docker container to build Qt 5.12 for Android x86 projects with OpenSSL
# Image: a12e/docker-qt:5.12-android_x86
FROM ubuntu:18.04
MAINTAINER Aurélien Brooke <dev@abrooke.fr>
ARG NDK_VERSION=r19c
ARG OPENSSL_VERSION=1.1.1c
ARG QT_VERSION=5.13.1
ARG SDK_BUILD_TOOLS=28.0.3
ARG SDK_PACKAGES="tools platform-tools"
ARG SDK_PLATFORM=android-21
ENV \
ANDROID_HOME=/opt/android-sdk \
ANDROID_NDK_ARCH=arch-x86_64 \
ANDROID_NDK_EABI=llvm \
ANDROID_NDK_HOST=linux-x86_64 \
ANDROID_NDK_TOOLCHAIN_PREFIX=x86_64 \
ANDROID_NDK_TOOLCHAIN_VERSION=4.9 \
DEBIAN_FRONTEND=noninteractive \
QMAKESPEC=android-clang \
QT_PATH=/opt/qt \
QT_PLATFORM=android_x86_64
ENV \
ANDROID_SDK_ROOT=${ANDROID_HOME} \
ANDROID_NDK_PLATFORM=${SDK_PLATFORM} \
ANDROID_NDK_ROOT=${ANDROID_HOME}/ndk-${NDK_VERSION} \
ANDROID_NDK_TOOLS_PREFIX=${ANDROID_NDK_TOOLCHAIN_PREFIX}
ENV \
ANDROID_DEV=${ANDROID_NDK_ROOT}/platforms/${ANDROID_NDK_PLATFORM}/${ANDROID_NDK_ARCH}/usr \
ANDROID_NDK_TOOLCHAIN=${ANDROID_NDK_ROOT}/toolchains/x86-${ANDROID_NDK_TOOLCHAIN_VERSION}/prebuilt/${ANDROID_NDK_HOST}
ENV \
PATH=${QT_PATH}/${QT_VERSION}/${QT_PLATFORM}/bin:${ANDROID_NDK_TOOLCHAIN}/${ANDROID_NDK_TOOLCHAIN_PREFIX}/bin:${ANDROID_NDK_ROOT}/toolchains/${ANDROID_NDK_EABI}/prebuilt/${ANDROID_NDK_HOST}/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${PATH}
# Install updates & requirements:
# * unzip - unpack platform tools
# * git, openssh-client, ca-certificates - clone & build
# * locales, sudo - useful to set utf-8 locale & sudo usage
# * curl - to download Qt bundle
# * make, openjdk-8-jdk-headless, ant - basic build requirements
# * libsm6, libice6, libxext6, libxrender1, libfontconfig1, libdbus-1-3, libx11-xcb1 - dependencies of Qt bundle run-file
# * libc6:i386, libncurses5:i386, libstdc++6:i386, libz1:i386 - dependencides of android sdk binaries
# * patch - to apply patches
RUN dpkg --add-architecture i386 && apt update && apt full-upgrade -y && apt install -y --no-install-recommends \
unzip \
git \
openssh-client \
ca-certificates \
locales \
sudo \
curl \
make \
openjdk-8-jdk-headless \
openjdk-8-jre-headless \
ant \
libsm6 \
libice6 \
libxext6 \
libxrender1 \
libfontconfig1 \
libdbus-1-3 \
libx11-xcb1 \
libc6:i386 \
libncurses5:i386 \
libstdc++6:i386 \
libz1:i386 \
patch \
&& apt-get -qq clean \
&& rm -rf /var/lib/apt/lists/*
COPY 3rdparty/* /tmp/build/
# Download & unpack Qt toolchain
COPY scripts/install-qt.sh /tmp/build/
RUN /tmp/build/install-qt.sh
# Download & unpack android SDK
COPY scripts/install-android-sdk.sh /tmp/build/
RUN /tmp/build/install-android-sdk.sh
# Download & unpack android NDK
COPY scripts/install-android-ndk.sh /tmp/build/
RUN /tmp/build/install-android-ndk.sh
# Download, build & install OpenSSL for Android
COPY scripts/install-openssl-android-clang.sh /tmp/build/
RUN /tmp/build/install-openssl-android-clang.sh \
# Reconfigure locale
&& locale-gen en_US.UTF-8 && dpkg-reconfigure locales \
# Add group & user, and make the SDK directory writable
&& groupadd -r user \
&& useradd --create-home --gid user user \
&& echo 'user ALL=NOPASSWD: ALL' > /etc/sudoers.d/user \
&& chown -R user:user $ANDROID_HOME
USER user
WORKDIR /home/user
ENV HOME /home/user