前段时间学习Docker,顺便应用到公司产品上,实现了自动化编译,确实比以前人工测试好多了,避免了很多由环境引起的问题。终于学会volume,可以把本地目录mount到docker里面去编译了。下面是编译记录:
mkdir android-6.0
repo init -u https://aosp.tuna.tsinghua.edu.cn/android/platform/manifest -b android-6.0.0_r25
repo sync -c
apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip
apt-get install openjdk-7-jdk
lunch aosp_arm-eng
make -j4
USER问题
JACKVMCOMMAND="java -Dfile.encoding=UTF-8 -Xms2560m -XX:+TieredCompilation -jar out/host/linux-x86/framework/jack-launcher.jar " JACK_JAR="out/host/linux-x86/framework/jack.jar" out/host/linux-x86/bin/jack-admin start-server
out/host/linux-x86/bin/jack-admin: line 27: USER: unbound variable
这是由于docker没有设置USER环境变量导致,手动添加后继续编译即可
export USER=$(whoami)