45 lines
1.7 KiB
Plaintext
45 lines
1.7 KiB
Plaintext
#
|
|
# Minimum Docker image to build Android AOSP
|
|
#
|
|
FROM ubuntu:18.04
|
|
ARG USER_ID=1001
|
|
ARG GROUP_ID=1001
|
|
|
|
# Keep the dependency list as short as reasonable
|
|
RUN apt-get update && \
|
|
apt-get install -y bc bison bsdmainutils build-essential curl \
|
|
flex g++-multilib gcc-multilib git gnupg gperf lib32ncurses5-dev \
|
|
lib32z1-dev libncurses5-dev \
|
|
libsdl1.2-dev libxml2-utils lzop \
|
|
openjdk-8-jdk \
|
|
genisoimage sudo \
|
|
gettext \
|
|
python-mako \
|
|
rsync \
|
|
pngcrush schedtool xsltproc zip zlib1g-dev libswitch-perl git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 libncurses5-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig && \
|
|
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
ADD https://commondatastorage.googleapis.com/git-repo-downloads/repo /usr/local/bin/
|
|
RUN chmod 755 /usr/local/bin/*
|
|
|
|
# All builds will be done by user aosp
|
|
RUN groupadd -g ${GROUP_ID} aosp && useradd --create-home aosp -u ${USER_ID} -g ${GROUP_ID} -s /bin/bash && echo "aosp:aosp" | chpasswd && adduser aosp sudo
|
|
ADD gitconfig /home/aosp/.gitconfig
|
|
ADD ssh_config /home/aosp/.ssh/config
|
|
RUN chown aosp:aosp /home/aosp/.gitconfig
|
|
|
|
# The persistent data will be in these two directories, everything else is
|
|
# considered to be ephemeral
|
|
VOLUME ["/tmp/ccache", "/aosp"]
|
|
|
|
# Improve rebuild performance by enabling compiler cache
|
|
ENV USE_CCACHE 1
|
|
ENV CCACHE_DIR /tmp/ccache
|
|
|
|
# Work in the build directory, repo is expected to be init'd here
|
|
USER aosp
|
|
WORKDIR /aosp
|
|
|
|
#Relogin to set env var such as USER
|
|
CMD sudo -E -iu aosp
|