-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
134 lines (117 loc) · 3.17 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Android Build Box based on Ubuntu 20.04 LTS
#
# 2020-04-27 by Yank555.lu
FROM ubuntu:focal
USER root
# Build Arguments
ARG USER_NAME
ARG USER_ID
ARG GROUP_ID
ARG GIT_NAME
ARG GIT_EMAIL
ARG ROOT_PASSWD
# Setup users and folders
RUN echo "root:$ROOT_PASSWD" | chpasswd
RUN addgroup --gid $GROUP_ID $USER_NAME
RUN adduser --home /home/$USER_NAME --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID $USER_NAME
RUN rm /home/$USER_NAME/.bashrc
COPY bashrc /home/$USER_NAME/.bashrc
RUN chown $USER_NAME:$USER_NAME /home/$USER_NAME/.bashrc
RUN chmod 644 /home/$USER_NAME/.bashrc
RUN mkdir /home/$USER_NAME/bin
RUN chown $USER_NAME:$USER_NAME /home/$USER_NAME/bin
RUN chmod 755 /home/$USER_NAME/bin
RUN mkdir /home/$USER_NAME/bin.local
RUN chown $USER_NAME:$USER_NAME /home/$USER_NAME/bin.local
RUN chmod 755 /home/$USER_NAME/bin.local
COPY android-environment /home/$USER_NAME/bin.local/android-environment
RUN chmod 755 /home/$USER_NAME/bin.local/android-environment
RUN mkdir /home/source
RUN chown $USER_NAME:$USER_NAME /home/source
RUN chmod 755 /home/source
RUN mkdir /home/out
RUN chown $USER_NAME:$USER_NAME /home/out
RUN chmod 777 /home/out
RUN mkdir /home/ccache
RUN chown $USER_NAME:$USER_NAME /home/ccache
RUN chmod 755 /home/ccache
RUN mkdir /home/$USER_NAME/.ssh
RUN chown $USER_NAME:$USER_NAME /home/$USER_NAME/.ssh
RUN chmod 700 /home/$USER_NAME/.ssh
COPY ssh-config /home/$USER_NAME/.ssh/config
RUN chown $USER_NAME:$USER_NAME /home/$USER_NAME/.ssh/config
RUN chmod 600 /home/$USER_NAME/.ssh/config
# Install dependencies
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get -y update && apt-get install -y --no-install-recommends \
build-essential \
file \
cpio \
apt-utils \
net-tools \
dnsutils \
inetutils-ping \
traceroute \
ccache \
flex \
bison \
gperf \
zip \
curl \
gnutls-bin \
zlib1g-dev \
gcc-multilib \
g++-multilib \
libc6-dev-i386 \
x11proto-core-dev \
libx11-dev \
lib32z-dev \
libgl1-mesa-dev \
libxml2-utils \
xsltproc \
unzip \
lib32ncurses5-dev \
uuid \
uuid-dev \
zlib1g-dev \
liblz-dev \
liblzo2-2 \
liblzo2-dev \
lzop \
u-boot-tools \
mtd-utils \
openjdk-8-jdk \
device-tree-compiler \
gdisk \
m4 \
libz-dev \
bc \
rsync \
git-core \
gnupg \
git \
schedtool \
libxml2-utils \
libssl-dev \
libtinfo-dev \
libtinfo5 \
libncurses5 \
libncurses5-dev \
python \
python3 \
ssh \
vim \
&& apt-get purge -y --auto-remove \
&& apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*
# Download latest repo command
RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /home/$USER_NAME/bin/repo
RUN chmod 755 /home/$USER_NAME/bin/repo
# Change user and working directory
USER $USER_NAME
WORKDIR /home/source
# Configure git identity
RUN git config --global user.email "$GIT_EMAIL"
RUN git config --global user.name "$GIT_NAME"
RUN git config --global http.postBuffer 1048576000
RUN git config --global color.ui auto
RUN echo `date +'%d/%m/%y %H:%M:%S'` > /home/$USER_NAME/.docker.image.timestamp