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
15+ ENV DEBIAN_FRONTEND noninteractive
1416RUN apt-get update && \
15- apt-get install -y bc bison bsdmainutils build-essential curl \
17+ apt-get install -y ca-certificates bc bison bsdmainutils build-essential curl \
1618 flex g++-multilib gcc-multilib git gnupg gperf lib32ncurses5-dev \
1719 lib32z1-dev libesd0-dev libncurses5-dev \
1820 libsdl1.2-dev libwxgtk3.0-dev libxml2-utils lzop sudo \
1921 openjdk-8-jdk \
2022 pngcrush schedtool xsltproc zip zlib1g-dev graphviz && \
21- apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
23+ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" ; \
24+ curl -Ls "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" | tee /usr/local/bin/gosu; \
25+ curl -Ls "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" | tee /usr/local/bin/gosu.asc \
26+ # verify the signature
27+ export GNUPGHOME="$(mktemp -d)" ; \
28+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
29+ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
30+ rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \
31+ chmod +x /usr/local/bin/gosu; \
32+ # verify it works
33+ gosu nobody true; \
34+ apt-get purge -y --auto-remove ca-certificates ; apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2235
2336ADD https://commondatastorage.googleapis.com/git-repo-downloads/repo /usr/local/bin/
2437RUN chmod 755 /usr/local/bin/*
@@ -28,8 +41,8 @@ RUN chmod 755 /usr/local/bin/*
2841WORKDIR /tmp
2942
3043# All builds will be done by user aosp
31- COPY gitconfig /root /.gitconfig
32- COPY ssh_config /root/.ssh /config
44+ COPY gitconfig /home/aosp /.gitconfig
45+ COPY ssh_config /home/aosp /config
3346
3447# The persistent data will be in these two directories, everything else is
3548# considered to be ephemeral
@@ -38,5 +51,5 @@ VOLUME ["/tmp/ccache", "/aosp"]
3851# Work in the build directory, repo is expected to be init'd here
3952WORKDIR /aosp
4053
41- COPY utils/docker_entrypoint.sh /root/ docker_entrypoint.sh
42- ENTRYPOINT ["/root/ docker_entrypoint.sh" ]
54+ COPY utils/docker_entrypoint.sh /docker_entrypoint.sh
55+ ENTRYPOINT ["/docker_entrypoint.sh" ]
0 commit comments