brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · bd864f6 Raw
60 lines · plain
1# ===----------------------------------------------------------------------===##2#3# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4# See https://llvm.org/LICENSE.txt for license information.5# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6#7# ===----------------------------------------------------------------------===##8 9FROM docker.io/library/ubuntu:jammy10 11RUN apt-get update && apt-get install -y \12    curl \13    netcat-openbsd \14    openjdk-11-jdk \15    sudo \16    unzip \17    && rm -rf /var/lib/apt/lists/*18 19ENV ANDROID_HOME=/opt/android/sdk20 21RUN curl -sL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o cmdline-tools.zip && \22    mkdir -p ${ANDROID_HOME} && \23    unzip cmdline-tools.zip -d ${ANDROID_HOME}/cmdline-tools && \24    mv ${ANDROID_HOME}/cmdline-tools/cmdline-tools ${ANDROID_HOME}/cmdline-tools/latest && \25    rm cmdline-tools.zip26ENV PATH="${ANDROID_HOME}/cmdline-tools/latest/bin:${PATH}"27 28RUN yes | sdkmanager --licenses29RUN sdkmanager --install emulator30ENV PATH="${ANDROID_HOME}/emulator:${PATH}"31 32ARG API  # e.g. 2133RUN sdkmanager --install "platforms;android-${API}"34 35ARG TYPE  # one of: default, google_apis, or google_apis_playstore36ARG ABI   # e.g. armeabi-v7a, x8637ENV EMU_PACKAGE_NAME="system-images;android-${API};${TYPE};${ABI}"38RUN sdkmanager --install "${EMU_PACKAGE_NAME}"39 40COPY ./emulator-entrypoint.sh /opt/emulator/bin/emulator-entrypoint.sh41COPY ./emulator-wait-for-ready.sh /opt/emulator/bin/emulator-wait-for-ready.sh42ENV PATH="/opt/emulator/bin:${PATH}"43ENV PATH="${ANDROID_HOME}/platform-tools:${PATH}"44 45# Setup password-less sudo so that /dev/kvm permissions can be changed. Run the46# emulator in an unprivileged user for reliability (and it might require it?)47RUN echo "ALL ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers48RUN useradd --create-home emulator49USER emulator50WORKDIR /home/emulator51 52# Size of emulator /data partition in megabytes.53ENV EMU_PARTITION_SIZE=819254 55EXPOSE 503756 57HEALTHCHECK CMD emulator-wait-for-ready.sh 558 59ENTRYPOINT ["emulator-entrypoint.sh"]60