1
0
mirror of https://github.com/stucki/docker-lineageos synced 2024-12-19 17:12:29 -05:00
docker-lineageos/Dockerfile

50 lines
1.6 KiB
Docker
Raw Normal View History

# 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
ENV DEBIAN_FRONTEND noninteractive
RUN sed -i 's/main$/main universe/' /etc/apt/sources.list
2014-02-02 05:52:53 -05:00
RUN apt-get -qq update
2016-03-13 10:00:21 -04:00
RUN apt-get -qqy upgrade
2014-02-02 05:52:53 -05:00
2016-08-19 13:03:30 -04:00
# Install build dependencies (source: https://wiki.cyanogenmod.org/w/Build_for_bullhead)
RUN apt-get install -y bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop maven openjdk-8-jdk pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev
2016-08-20 16:08:52 -04:00
# For 64-bit systems
2016-08-19 13:03:30 -04:00
RUN apt-get install -y g++-multilib gcc-multilib lib32ncurses5-dev lib32readline6-dev lib32z1-dev
# Install additional packages which are useful for building Android
2017-01-03 04:37:11 -05:00
RUN apt-get install -y ccache rsync tig sudo imagemagick
RUN apt-get install -y android-tools-adb android-tools-fastboot
RUN apt-get install -y bc bsdmainutils file screen
2016-03-31 15:54:13 -04:00
RUN apt-get install -y bash-completion wget nano
2014-02-02 05:52:53 -05:00
2017-01-03 13:15:12 -05:00
RUN useradd build && rsync -a /etc/skel/ /home/build/
2014-02-02 05:52:53 -05:00
2017-01-03 13:15:12 -05:00
RUN mkdir /home/build/bin
RUN curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > /home/build/bin/repo
RUN chmod a+x /home/build/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
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
# Set global variables
ADD android-env-vars.sh /etc/android-env-vars.sh
RUN echo "source /etc/android-env-vars.sh" >> /etc/bash.bashrc
2014-02-02 05:52:53 -05: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
CMD /home/build/startup.sh
2015-03-16 05:19:07 -04:00
2017-01-03 13:15:12 -05:00
USER build
WORKDIR /home/build/android