forked from qiushao/aosp_builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (60 loc) · 2.18 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
# base image
FROM ubuntu:14.04
# MAINTAINER
MAINTAINER [email protected]
# use base as sh instead of dash
RUN ln -sf /bin/bash /bin/sh
# add user
RUN useradd -d /home/builder -m builder
ADD user.txt /home/builder
RUN chpasswd < /home/builder/user.txt
RUN rm /home/builder/user.txt
RUN echo "builder ALL=(ALL) ALL" >> /etc/sudoers
# support i386
RUN dpkg --add-architecture i386
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y lib32z1 lib32ncurses5 lib32bz2-1.0
# jdk setting
RUN mkdir -p /usr/lib/jvm
ADD tools/jdk1.6.0_45.tar.gz /usr/lib/jvm
RUN apt-get install -y software-properties-common
#RUN add-apt-repository -y ppa:openjdk-r/ppa
RUN add-apt-repository -y ppa:openjdk-r/ppa
RUN apt-get update
RUN apt-get install -y openjdk-7-jdk
RUN apt-get install -y openjdk-8-jdk
# java env setting, default jdk1.6
ENV JAVA_HOME /usr/lib/jvm/jdk1.6.0_45
ENV PATH $JAVA_HOME/bin:$PATH
RUN echo "" >> /home/builder/.bashrc
RUN echo "# jdk setting" >> /home/builder/.bashrc
RUN echo "export JAVA_HOME=$JAVA_HOME" >> /home/builder/.bashrc
RUN echo 'export PATH="$JAVA_HOME/bin:$PATH"' >> /home/builder/.bashrc
# compile toolchain
RUN apt-get install -y gcc-multilib g++-multilib build-essential
RUN apt-get install -y git-core gnupg bison flex gperf pngcrush bc zip curl lzop
RUN apt-get install -y schedtool libxml2 libxml2-utils xsltproc squashfs-tools
RUN apt-get install -y libesd0-dev libsdl1.2-dev libwxgtk2.8-dev libswitch-perl
RUN apt-get install -y libssl1.0.0 libssl-dev lib32readline-gplv2-dev libncurses5-dev
RUN apt-get install -y mtd-utils uuid-dev texinfo u-boot-tools
# use ccache
RUN apt-get install -y ccache
RUN echo "export USE_CCACHE=1" >> /home/builder/.bashrc
RUN echo "" >> /home/builder/.bashrc
# vim setting
RUN apt-get install -y vim
ADD tools/vimrc /home/builder/.vimrc
#set umask 0022
RUN echo "umask 0022" >> /home/builder/.bashrc
RUN echo "" >> /home/builder/.bashrc
#set locale
RUN locale-gen zh_CN.UTF-8
RUN locale-gen en_US.UTF-8
RUN echo 'export LC_ALL="en_US.UTF-8"' >> /home/builder/.bashrc
RUN echo 'export LANG="en_US.UTF-8"' >> /home/builder/.bashrc
RUN echo "" >> /home/builder/.bashrc
# android source volume
USER builder
WORKDIR /home/builder
ENV USER builder