infra/stacks/android-emulator/docker/Dockerfile
Viktor Barzin 8b7c77c794 android-emulator: new stack — shared in-cluster Android 16 testing instance
Viktor is setting up an Android app development pipeline (tripit is the
first app) and wants agents to natively test changes on Android before
shipping. This adds the testing environment: an API-36 Google emulator
under KVM as a privileged pod (namespace joins the Kyverno exclude list),
SDK/system-image/AVD on a proxmox-lvm PVC, adb on the shared MetalLB IP
10.0.20.200:5555 (LAN only), noVNC screen view at
android-emulator.viktorbarzin.lan. Image is built manually from the
stack's docker/ dir (rare rebuilds; off-infra-CI rule targets repeated
builds). First infra ADR records the trade-offs (devvm/VM/redroid/budtmo
rejected).
2026-06-11 19:51:57 +00:00

43 lines
2 KiB
Docker

# Android emulator runner — slim on purpose: the SDK proper (platform-tools,
# emulator, system image, AVD) lives on the stack's PVC and is installed by
# entrypoint.sh on first boot, so this image carries only the JDK,
# cmdline-tools and the native libraries the emulator needs at runtime.
#
# Rebuild + push (rare — only when tool/library versions bump):
# docker build -t forgejo.viktorbarzin.me/viktor/android-emulator:api36-v1 .
# docker push forgejo.viktorbarzin.me/viktor/android-emulator:api36-v1
FROM eclipse-temurin:17-jdk-jammy
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
# emulator runtime deps (Qt window into Xvfb)
libpulse0 libgl1 libglu1-mesa libnss3 libasound2 libfontconfig1 \
libx11-6 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 \
libxfixes3 libxi6 libxrandr2 libxrender1 libxtst6 libxkbcommon0 \
libxkbfile1 libsm6 libice6 libdbus-1-3 \
# virtual display + browser viewing
xvfb x11vnc novnc websockify openbox \
# adb TCP forwarding + fetch tooling
socat wget unzip ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Android cmdline-tools (sdkmanager/avdmanager). Pinned; SDK packages they
# install land on the PVC at /sdk, not in this image.
ARG CMDLINE_TOOLS_VERSION=13114758
RUN mkdir -p /opt/android/cmdline-tools && \
wget -q "https://dl.google.com/android/repository/commandlinetools-linux-${CMDLINE_TOOLS_VERSION}_latest.zip" -O /tmp/clt.zip && \
unzip -q /tmp/clt.zip -d /opt/android/cmdline-tools && \
mv /opt/android/cmdline-tools/cmdline-tools /opt/android/cmdline-tools/latest && \
rm /tmp/clt.zip
ENV ANDROID_SDK_ROOT=/sdk \
ANDROID_USER_HOME=/sdk/.android \
ANDROID_AVD_HOME=/sdk/.android/avd \
PATH="/opt/android/cmdline-tools/latest/bin:/sdk/platform-tools:/sdk/emulator:${PATH}"
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# 5555 adb (socat → emulator adbd), 6080 noVNC web UI
EXPOSE 5555 6080
ENTRYPOINT ["/entrypoint.sh"]