Skip to content

Commit 2ee12e4

Browse files
committed
Dockerfile: install latest version of JDK
The image now provides both openjdk-7 and openjdk-8
1 parent d7f0c4f commit 2ee12e4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,25 @@ RUN apt-get update && \
2323
ADD https://commondatastorage.googleapis.com/git-repo-downloads/repo /usr/local/bin/
2424
RUN chmod 755 /usr/local/bin/*
2525

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+
2645
# All builds will be done by user aosp
2746
RUN groupadd -r aosp && useradd --create-home -g aosp aosp
2847
COPY gitconfig /home/aosp/.gitconfig

0 commit comments

Comments
 (0)