-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
99 lines (91 loc) · 2.44 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
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
# Build environment for LineageOS
FROM debian:buster
MAINTAINER Caleb Xu <[email protected]>
ENV \
# ccache specifics
CCACHE_SIZE=50G \
CCACHE_DIR=/srv/ccache \
USE_CCACHE=1 \
CCACHE_COMPRESS=1 \
# Configure Jack
ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G" \
# Extra include PATH, it may not include /usr/local/(s)bin on some systems
PATH=$PATH:/usr/local/bin/
RUN sed -i 's/main$/main contrib non-free/' /etc/apt/sources.list \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get update -y \
&& apt-get clean -y \
&& apt-get install -y locales \
&& locale-gen --purge en_US.UTF-8 \
&& echo -e 'LANG="en_US.UTF-8"\nLANGUAGE="en_US:en"\n' > /etc/default/locale \
&& apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y \
# Install build dependencies (source: https://wiki.cyanogenmod.org/w/Build_for_bullhead)
bison \
build-essential \
curl \
flex \
git \
gnupg \
gperf \
kmod \
liblz4-tool \
libncurses5-dev \
libncursesw6 \
libsdl1.2-dev \
libwxgtk3.0-dev \
libxml2 \
libxml2-utils \
lzop \
maven \
openjdk-11-jdk-headless \
pngcrush \
procps \
python \
schedtool \
squashfs-tools \
xsltproc \
zip \
zlib1g-dev \
# For 64-bit systems
g++-multilib \
gcc-multilib \
lib32ncurses5-dev \
lib32readline6-dev \
lib32z1-dev \
# Install additional packages which are useful for building Android
android-tools-adb \
android-tools-fastboot \
bash-completion \
bc \
bsdmainutils \
ccache \
file \
git \
imagemagick \
nano \
rsync \
sudo \
tig \
tmux \
vim \
wget \
&& rm -rf /var/lib/apt/lists/*
ARG hostuid=1000
ARG hostgid=1000
ADD startup.sh /home/build/startup.sh
RUN groupadd --gid $hostgid --force build \
&& useradd --gid $hostgid --uid $hostuid --non-unique build \
&& rsync -a /etc/skel/ /home/build/ \
&& curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo \
&& chmod a+x /usr/local/bin/repo \
&& git config --system protocol.version 2 \
&& echo "build ALL=NOPASSWD: ALL" > /etc/sudoers.d/build \
&& chmod a+x /home/build/startup.sh \
&& chown -R build:build /home/build
VOLUME /home/build/android
VOLUME /srv/ccache
USER build
WORKDIR /home/build/android
CMD /home/build/startup.sh