33#
44FROM ubuntu:16.04
55
6- MAINTAINER Kyle Manna <kyle@kylemanna.com>
6+ LABEL maintainer " Kyle Manna <kyle@kylemanna.com>"
77
88# /bin/sh points to Dash by default, reconfigure to use bash until Android
99# build becomes POSIX compliant
1010RUN echo "dash dash/sh boolean false" | debconf-set-selections && \
1111 dpkg-reconfigure -p critical dash
1212
1313# Keep the dependency list as short as reasonable
14+ ENV GOSU_VERSION=1.10
1415RUN apt-get update && \
1516 apt-get install -y bc bison bsdmainutils build-essential curl \
1617 flex g++-multilib gcc-multilib git gnupg gperf lib32ncurses5-dev \
1718 lib32z1-dev libesd0-dev libncurses5-dev \
1819 libsdl1.2-dev libwxgtk3.0-dev libxml2-utils lzop sudo \
1920 openjdk-8-jdk \
2021 pngcrush schedtool xsltproc zip zlib1g-dev graphviz && \
21- apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
22+ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" ; \
23+ curl -Ls "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" | tee /usr/local/bin/gosu; \
24+ curl -Ls "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" | tee /usr/local/bin/gosu.asc \
25+ # verify the signature
26+ export GNUPGHOME="$(mktemp -d)" ; \
27+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
28+ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
29+ rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \
30+ chmod +x /usr/local/bin/gosu; \
31+ # verify it works
32+ gosu nobody true; \
33+ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2234
2335ADD https://commondatastorage.googleapis.com/git-repo-downloads/repo /usr/local/bin/
2436RUN chmod 755 /usr/local/bin/*
@@ -28,8 +40,8 @@ RUN chmod 755 /usr/local/bin/*
2840WORKDIR /tmp
2941
3042# All builds will be done by user aosp
31- COPY gitconfig /root /.gitconfig
32- COPY ssh_config /root/.ssh /config
43+ COPY gitconfig /home/aosp /.gitconfig
44+ COPY ssh_config /home/aosp /config
3345
3446# The persistent data will be in these two directories, everything else is
3547# considered to be ephemeral
@@ -38,5 +50,5 @@ VOLUME ["/tmp/ccache", "/aosp"]
3850# Work in the build directory, repo is expected to be init'd here
3951WORKDIR /aosp
4052
41- COPY utils/docker_entrypoint.sh /root/ docker_entrypoint.sh
42- ENTRYPOINT ["/root/ docker_entrypoint.sh" ]
53+ COPY utils/docker_entrypoint.sh /docker_entrypoint.sh
54+ ENTRYPOINT ["/docker_entrypoint.sh" ]
0 commit comments