|
3 | 3 | #
|
4 | 4 | FROM ubuntu:14.04
|
5 | 5 |
|
6 |
| -MAINTAINER Kyle Manna < [email protected]> |
| 6 | +LABEL maintainer "Kyle Manna <[email protected]>" |
7 | 7 |
|
8 | 8 | # /bin/sh points to Dash by default, reconfigure to use bash until Android
|
9 | 9 | # build becomes POSIX compliant
|
10 | 10 | RUN echo "dash dash/sh boolean false" | debconf-set-selections && \
|
11 | 11 | dpkg-reconfigure -p critical dash
|
12 | 12 |
|
13 | 13 | # Keep the dependency list as short as reasonable
|
| 14 | +ENV GOSU_VERSION 1.10 |
14 | 15 | RUN apt-get update && \
|
15 | 16 | apt-get install -y bc bison bsdmainutils build-essential curl \
|
16 | 17 | flex g++-multilib gcc-multilib git gnupg gperf lib32ncurses5-dev \
|
17 | 18 | lib32readline-gplv2-dev lib32z1-dev libesd0-dev libncurses5-dev \
|
18 | 19 | libsdl1.2-dev libwxgtk2.8-dev libxml2-utils lzop \
|
19 | 20 | openjdk-7-jdk \
|
20 | 21 | pngcrush schedtool xsltproc zip zlib1g-dev && \
|
21 |
| - apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
22 |
| - |
| 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; apt-get purge --auto-remove ca-certificates; \ |
| 34 | + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
23 | 35 | ADD https://commondatastorage.googleapis.com/git-repo-downloads/repo /usr/local/bin/
|
24 | 36 | RUN chmod 755 /usr/local/bin/*
|
25 | 37 |
|
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 |
| -RUN curl -O http://mirrors.kernel.org/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre-headless_8u45-b14-1_amd64.deb && \ |
30 |
| - curl -O http://mirrors.kernel.org/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre_8u45-b14-1_amd64.deb && \ |
31 |
| - curl -O http://mirrors.kernel.org/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk_8u45-b14-1_amd64.deb && \ |
32 |
| - sum=`shasum ./openjdk-8-jre-headless_8u45-b14-1_amd64.deb | awk '{ print $1 }'` && \ |
33 |
| - [ $sum == "e10d79f7fd1b3d011d9a4910bc3e96c3090f3306" ] || \ |
34 |
| - ( echo "Hash mismatch. Problem downloading openjdk-8-jre-headless" ; exit 1; ) && \ |
35 |
| - sum=`shasum ./openjdk-8-jre_8u45-b14-1_amd64.deb | awk '{ print $1 }'` && \ |
36 |
| - [ $sum == "1e083bb952fc97ab33cd46f68e82688d2b8acc34" ] || \ |
37 |
| - ( echo "Hash mismatch. Problem downloading openjdk-8-jre" ; exit 1; ) && \ |
38 |
| - sum=`shasum ./openjdk-8-jdk_8u45-b14-1_amd64.deb | awk '{ print $1 }'` && \ |
39 |
| - [ $sum == "772e904961a2a5c7d2d129bdbcfd5c16a0fab4bf" ] || \ |
40 |
| - ( echo "Hash mismatch. Problem downloading openjdk-8-jdk" ; exit 1; ) && \ |
41 |
| - dpkg -i *.deb && \ |
42 |
| - apt-get -f install && \ |
43 |
| - apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
44 |
| - |
45 | 38 | # All builds will be done by user aosp
|
46 |
| -COPY gitconfig /root/.gitconfig |
47 |
| -COPY ssh_config /root/.ssh/config |
| 39 | +COPY gitconfig /home/aosp/.gitconfig |
| 40 | +COPY ssh_config /home/aosp/.ssh/config |
48 | 41 |
|
49 | 42 | # The persistent data will be in these two directories, everything else is
|
50 | 43 | # considered to be ephemeral
|
51 | 44 | VOLUME ["/tmp/ccache", "/aosp"]
|
52 | 45 |
|
53 | 46 | # Work in the build directory, repo is expected to be init'd here
|
54 | 47 | WORKDIR /aosp
|
55 |
| - |
56 |
| -COPY utils/docker_entrypoint.sh /root/docker_entrypoint.sh |
57 |
| -ENTRYPOINT ["/root/docker_entrypoint.sh"] |
| 48 | +COPY utils/docker_entrypoint.sh /docker_entrypoint.sh |
| 49 | +ENTRYPOINT ["/docker_entrypoint.sh"] |
0 commit comments