2017-01-03 15:32:06 -05:00
|
|
|
# Build environment for LineageOS
|
2014-02-02 05:52:53 -05:00
|
|
|
|
2016-08-19 13:03:30 -04:00
|
|
|
FROM ubuntu:16.04
|
2017-01-03 15:30:34 -05:00
|
|
|
MAINTAINER Michael Stucki <michael@stucki.io>
|
2014-02-02 05:52:53 -05:00
|
|
|
|
2017-05-30 13:24:02 -04:00
|
|
|
|
2017-05-30 13:19:31 -04:00
|
|
|
ENV \
|
2017-05-30 13:24:02 -04:00
|
|
|
# ccache specifics
|
|
|
|
CCACHE_SIZE=50G \
|
|
|
|
CCACHE_DIR=/srv/ccache \
|
|
|
|
USE_CCACHE=1 \
|
|
|
|
CCACHE_COMPRESS=1 \
|
2017-05-30 13:19:31 -04:00
|
|
|
# Extra include PATH, it may not include /usr/local/(s)bin on some systems
|
|
|
|
PATH=$PATH:/usr/local/bin/
|
|
|
|
|
2017-05-30 05:58:38 -04:00
|
|
|
RUN sed -i 's/main$/main universe/' /etc/apt/sources.list \
|
|
|
|
&& export DEBIAN_FRONTEND=noninteractive \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get upgrade -y \
|
|
|
|
&& apt-get install -y \
|
2016-08-19 13:03:30 -04:00
|
|
|
# Install build dependencies (source: https://wiki.cyanogenmod.org/w/Build_for_bullhead)
|
2018-11-02 12:36:49 -04:00
|
|
|
bc \
|
2017-05-30 05:58:38 -04:00
|
|
|
bison \
|
|
|
|
build-essential \
|
2018-11-02 12:36:49 -04:00
|
|
|
ccache \
|
2017-05-30 05:58:38 -04:00
|
|
|
curl \
|
|
|
|
flex \
|
2018-11-02 12:36:49 -04:00
|
|
|
g++-multilib \
|
|
|
|
gcc-multilib \
|
2017-05-30 05:58:38 -04:00
|
|
|
git \
|
|
|
|
gnupg \
|
|
|
|
gperf \
|
2018-11-02 12:36:49 -04:00
|
|
|
imagemagick \
|
|
|
|
lib32ncurses5-dev \
|
|
|
|
lib32readline-dev \
|
|
|
|
lib32z1-dev \
|
2017-05-30 05:58:38 -04:00
|
|
|
liblz4-tool \
|
|
|
|
libncurses5-dev \
|
|
|
|
libsdl1.2-dev \
|
2018-11-02 12:36:49 -04:00
|
|
|
libssl-dev \
|
2017-05-30 05:58:38 -04:00
|
|
|
libwxgtk3.0-dev \
|
|
|
|
libxml2 \
|
|
|
|
libxml2-utils \
|
|
|
|
lzop \
|
|
|
|
pngcrush \
|
2018-11-02 12:36:49 -04:00
|
|
|
rsync \
|
2017-05-30 05:58:38 -04:00
|
|
|
schedtool \
|
|
|
|
squashfs-tools \
|
|
|
|
xsltproc \
|
|
|
|
zip \
|
|
|
|
zlib1g-dev \
|
2018-11-02 12:36:49 -04:00
|
|
|
# Install Java Development Kit
|
|
|
|
openjdk-8-jdk \
|
2016-03-13 10:17:17 -04:00
|
|
|
# Install additional packages which are useful for building Android
|
2017-05-30 05:58:38 -04:00
|
|
|
android-tools-adb \
|
|
|
|
android-tools-fastboot \
|
|
|
|
bash-completion \
|
|
|
|
bsdmainutils \
|
|
|
|
file \
|
|
|
|
nano \
|
|
|
|
screen \
|
|
|
|
sudo \
|
|
|
|
tig \
|
2017-06-06 06:32:35 -04:00
|
|
|
vim \
|
2017-05-30 05:58:38 -04:00
|
|
|
wget \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2014-02-02 05:52:53 -05:00
|
|
|
|
2017-04-19 12:10:56 -04:00
|
|
|
ARG hostuid=1000
|
|
|
|
ARG hostgid=1000
|
|
|
|
|
|
|
|
RUN \
|
2017-04-21 04:14:08 -04:00
|
|
|
groupadd --gid $hostgid --force build && \
|
|
|
|
useradd --gid $hostgid --uid $hostuid --non-unique build && \
|
2017-04-19 12:10:56 -04:00
|
|
|
rsync -a /etc/skel/ /home/build/
|
2014-02-02 05:52:53 -05:00
|
|
|
|
2017-08-05 16:59:08 -04:00
|
|
|
RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo \
|
2017-05-30 13:19:31 -04:00
|
|
|
&& chmod a+x /usr/local/bin/repo
|
2014-02-02 05:52:53 -05:00
|
|
|
|
2015-03-16 05:19:07 -04:00
|
|
|
# Add sudo permission
|
2017-01-03 13:15:12 -05:00
|
|
|
RUN echo "build ALL=NOPASSWD: ALL" > /etc/sudoers.d/build
|
2015-03-16 05:19:07 -04:00
|
|
|
|
2017-01-03 13:15:12 -05:00
|
|
|
ADD startup.sh /home/build/startup.sh
|
|
|
|
RUN chmod a+x /home/build/startup.sh
|
2016-03-13 09:54:07 -04:00
|
|
|
|
2015-03-16 05:19:07 -04:00
|
|
|
# Fix ownership
|
2017-01-03 13:15:12 -05:00
|
|
|
RUN chown -R build:build /home/build
|
2015-03-16 05:19:07 -04:00
|
|
|
|
2017-01-03 13:15:12 -05:00
|
|
|
VOLUME /home/build/android
|
2014-06-28 10:19:18 -04:00
|
|
|
VOLUME /srv/ccache
|
|
|
|
|
2017-01-03 13:15:12 -05:00
|
|
|
USER build
|
|
|
|
WORKDIR /home/build/android
|
2017-05-30 13:38:12 -04:00
|
|
|
|
|
|
|
CMD /home/build/startup.sh
|