33#
44FROM ubuntu:16.04
55
6- MAINTAINER Kyle Manna <kyle@kylemanna.com>
6+ LABEL maintainer "Kyle Manna <kyle@kylemanna.com>"
7+
8+ ENV GOSU_VERSION=1.10
9+ ENV DEBIAN_FRONTEND noninteractive
710
811# /bin/sh points to Dash by default, reconfigure to use bash until Android
912# build becomes POSIX compliant
@@ -12,24 +15,31 @@ RUN echo "dash dash/sh boolean false" | debconf-set-selections && \
1215
1316# Keep the dependency list as short as reasonable
1417RUN apt-get update && \
15- apt-get install -y bc bison bsdmainutils build-essential curl \
18+ apt-get install -y ca-certificates bc bison bsdmainutils build-essential curl \
1619 flex g++-multilib gcc-multilib git gnupg gperf lib32ncurses5-dev \
1720 lib32z1-dev libesd0-dev libncurses5-dev \
1821 libsdl1.2-dev libwxgtk3.0-dev libxml2-utils lzop sudo \
1922 openjdk-8-jdk \
2023 pngcrush schedtool xsltproc zip zlib1g-dev graphviz && \
21- apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
24+ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" ; \
25+ curl -Ls "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" -o /usr/local/bin/gosu; \
26+ curl -Ls "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" -o /usr/local/bin/gosu.asc \
27+ # verify the signature
28+ export GNUPGHOME="$(mktemp -d)" ; \
29+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
30+ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
31+ rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
32+ chmod +x /usr/local/bin/gosu; \
33+ # verify it works
34+ gosu nobody true; \
35+ apt-get purge -y --auto-remove ca-certificates ; apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2236
2337ADD https://commondatastorage.googleapis.com/git-repo-downloads/repo /usr/local/bin/
2438RUN chmod 755 /usr/local/bin/*
2539
26- # Install latest version of JDK
27- # See http://source.android.com/source/initializing.html#setting-up-a-linux-build-environment
28- WORKDIR /tmp
29-
3040# All builds will be done by user aosp
31- COPY gitconfig /root /.gitconfig
32- COPY ssh_config /root /.ssh/config
41+ COPY gitconfig /home/aosp /.gitconfig
42+ COPY ssh_config /home/aosp /.ssh/config
3343
3444# The persistent data will be in these two directories, everything else is
3545# considered to be ephemeral
@@ -38,5 +48,5 @@ VOLUME ["/tmp/ccache", "/aosp"]
3848# Work in the build directory, repo is expected to be init'd here
3949WORKDIR /aosp
4050
41- COPY utils/docker_entrypoint.sh /root/ docker_entrypoint.sh
42- ENTRYPOINT ["/root/ docker_entrypoint.sh" ]
51+ COPY utils/docker_entrypoint.sh /docker_entrypoint.sh
52+ ENTRYPOINT ["/docker_entrypoint.sh" ]
0 commit comments