Skip to content

Commit

Permalink
JDK17 from corretto
Browse files Browse the repository at this point in the history
And a few layers squashing
  • Loading branch information
menny committed Apr 18, 2023
1 parent cf8fdda commit 9931644
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
45 changes: 26 additions & 19 deletions android_base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
FROM adoptopenjdk/openjdk11:jdk-11.0.12_7-ubuntu-slim
FROM ubuntu:focal@sha256:b795f8e0caaaacad9859a9a38fe1c78154f8301fdaf0872eaf1520d66d9c0b98
ARG IMAGE_VERSION

LABEL description="A general use Android docker for CI"
LABEL version="${IMAGE_VERSION}"
LABEL maintainer="[email protected]"

# disable interactive functions
ENV DEBIAN_FRONTEND noninteractive
ENV TERM dumb

# Install Deps and build-essential
RUN dpkg --add-architecture i386
RUN apt-get update
RUN apt-get install -y --allow-remove-essential --allow-change-held-packages \
software-properties-common locales ca-certificates build-essential zlib1g-dev \
libc6-i386 lib32stdc++6 lib32gcc1 lib32z1 pkg-config g++ \
python python3 python3-pip python-lxml python-yaml libxml2-utils \
wget curl nano rsync sudo zip psmisc rsyslog jq unzip
RUN apt-get update \
&& apt-get install -y --allow-remove-essential --allow-change-held-packages \
locales software-properties-common ca-certificates build-essential zlib1g-dev \
libc6-i386 lib32stdc++6 lib32gcc1 lib32z1 pkg-config g++ \
python python3 python3-pip python-lxml python-yaml libxml2-utils \
wget curl nano rsync sudo zip psmisc rsyslog jq unzip \
java-common \
&& apt-get clean
# this is required for the latest git (ubuntu's official git is quite old)
RUN add-apt-repository ppa:git-core/ppa -y
RUN apt-get install -y --allow-remove-essential --allow-change-held-packages git

RUN apt-get clean
RUN add-apt-repository ppa:git-core/ppa -y \
&& apt-get install -y --allow-remove-essential --allow-change-held-packages git \
&& apt-get clean

RUN touch /var/log/kern.log ; chown syslog:adm /var/log/kern.log

RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# disable interactive functions
ENV DEBIAN_FRONTEND noninteractive

RUN mkdir -p /opt
WORKDIR /opt
Expand All @@ -37,14 +39,19 @@ RUN chmod +x /opt/tools/start_emulator.sh
ENV ANDROID_HOME /opt/android-sdk-linux
ENV PATH ${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools

# Setup Java
RUN curl https://corretto.aws/downloads/resources/17.0.6.10.1/java-17-amazon-corretto-jdk_17.0.6.10-1_amd64.deb -o jdk-corretto.deb \
&& dpkg --install jdk-corretto.deb \
&& rm jdk-corretto.deb

RUN java -version

# Install Android SDK
ADD https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip downloaded_sdk.zip
RUN mkdir -p /opt/android-sdk-linux/cmdline-tools
RUN unzip downloaded_sdk.zip -d /opt/android-sdk-linux/cmdline-tools
RUN rm -f downloaded_sdk.zip
RUN mv /opt/android-sdk-linux/cmdline-tools/cmdline-tools /opt/android-sdk-linux/cmdline-tools/latest
RUN curl https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip -o downloaded_sdk.zip \
&& mkdir -p /opt/android-sdk-linux/cmdline-tools \
&& unzip downloaded_sdk.zip -d /opt/android-sdk-linux/cmdline-tools \
&& rm -f downloaded_sdk.zip \
&& mv /opt/android-sdk-linux/cmdline-tools/cmdline-tools /opt/android-sdk-linux/cmdline-tools/latest

#accepting licenses
RUN yes | sdkmanager --licenses
Expand Down
4 changes: 2 additions & 2 deletions android_base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ My general usage (very up-to-date) Docker image for Android CI. Without anything

## Contains:

* Based on `ubuntu:18.04`
* Based on `ubuntu:focal`
* with wget, curl, zip, python, python3, pip, rsyslog, git, make, gcc (and other build-essential)
* AdoptJDK11 - https://github.com/AdoptOpenJDK (including CA Root Certificates)
* Corretto JDK17 - https://github.com/corretto/corretto-17/releases
* Compressed and squashed into one layer.

## Accepting licenses
Expand Down

0 comments on commit 9931644

Please sign in to comment.