From 6accf19f1dc18b1743b733963fae2cc620ae9ab9 Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Fri, 3 Apr 2026 08:38:28 +0000 Subject: [PATCH 01/14] feat: add multiversion Android support via environment variables - Add ANDROID_VERSION and GAPPS_VERSION environment variables - Support for Android 11 (API 30), 12 (API 31), 13 (API 33), and 14 (API 34) - Create .env.example with all configurable options - Update Dockerfile to accept ANDROID_VERSION as build arg - Update first-boot.sh to dynamically handle version-specific GAPPS and AVD creation - Add env_file reference in docker-compose.yml - Update README with new environment variable documentation BREAKING CHANGE: None - maintains backward compatibility with default ANDROID_VERSION=30 --- .env.example | 8 +++++++ Dockerfile | 4 +++- README.md | 4 +++- docker-compose.yml | 4 +++- first-boot.sh | 60 ++++++++++++++++++++++++++++++++++------------ 5 files changed, 62 insertions(+), 18 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..7122beb --- /dev/null +++ b/.env.example @@ -0,0 +1,8 @@ +ANDROID_VERSION=30 +GAPPS_VERSION=11 +DNS=one.one.one.one +RAM_SIZE=4096 +SCREEN_RESOLUTION=1080x1920 +SCREEN_DENSITY=320 +ROOT_SETUP=0 +GAPPS_SETUP=0 diff --git a/Dockerfile b/Dockerfile index 07a615a..4bbd26e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ FROM ubuntu:20.04 +ARG ANDROID_VERSION=30 +ENV ANDROID_VERSION=${ANDROID_VERSION} # Install necessary packages RUN apt-get update && \ @@ -44,7 +46,7 @@ RUN mkdir /root/.android/ && \ # Detect architecture and set environment variable -RUN yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" "platform-tools" "platforms;android-30" "system-images;android-30;default;x86_64" +RUN yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" "platform-tools" "platforms;android-${ANDROID_VERSION}" "system-images;android-${ANDROID_VERSION};default;x86_64" # remove /opt/android-sdk/emulator/crashpad_handler RUN rm -f /opt/android-sdk/emulator/crashpad_handler # RUN if [ "$(uname -m)" = "aarch64" ]; then \ diff --git a/README.md b/README.md index f0fce8e..d8b515f 100644 --- a/README.md +++ b/README.md @@ -145,13 +145,15 @@ scrcpy -s localhost:5555 | `SCREEN_DENSITY` | Screen pixel density in DPI | device default | | `ROOT_SETUP` | Set to `1` to enable rooting and Magisk. Can be turned on after the first start but cannot be undone without recreating the data volume. | `0` | | `GAPPS_SETUP` | Set to `1` to install PICO GAPPS. Can be turned on after the first start but cannot be undone without recreating the data volume. | `0` | +| `ANDROID_VERSION` | Android API version to emulate (30 = Android 11, 31 = Android 12, 33 = Android 13, 34 = Android 14). Also enables multi-version support. | `30` | +| `GAPPS_VERSION` | GAPPS version to download. Default behavior derives from ANDROID_VERSION. | `11` | ## 🔄 **First Boot Process** The first time you start the container, it will perform a comprehensive setup process that includes: -1. **AVD Creation:** Creates a new Android Virtual Device running Android 30 (Android 11) +1. **AVD Creation:** Creates a new Android Virtual Device using the Android version configured via ANDROID_VERSION (default 30 – Android 11). This value selects the platform image (e.g., android-${ANDROID_VERSION}) for the AVD and SDK downloads. 2. **PICO GAPPS Installation** (when `GAPPS_SETUP=1`): Adds essential Google services. 3. **Rooting the Device** (when `ROOT_SETUP=1`): Performs multiple reboots to: - Disable AVB verification diff --git a/docker-compose.yml b/docker-compose.yml index 1dd05c4..1609f4f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,12 +5,15 @@ services: image: shmayro/dockerify-android:latest build: context: . + env_file: + - .env ports: - "5555:5555" volumes: - ./data:/data - ./extras:/extras environment: + ANDROID_VERSION: 30 DNS: one.one.one.one # RAM_SIZE: 4096 # Optional screen resolution in WIDTHxHEIGHT format @@ -38,4 +41,3 @@ services: adb connect dockerify-android:5555 && npm start " - diff --git a/first-boot.sh b/first-boot.sh index f69c81d..f7cbfe0 100755 --- a/first-boot.sh +++ b/first-boot.sh @@ -1,5 +1,9 @@ #!/bin/bash +# Android version and GAPPS version handling (defaults kept backward compatible) +ANDROID_VERSION=${ANDROID_VERSION:-30} +GAPPS_VERSION=${GAPPS_VERSION:-11} + bool_true() { case "${1,,}" in 1|true|yes) return 0 ;; @@ -44,30 +48,56 @@ prepare_system() { install_gapps() { prepare_system echo "Installing GAPPS ..." - wget https://sourceforge.net/projects/opengapps/files/x86_64/20220503/open_gapps-x86_64-11.0-pico-20220503.zip/download -O gapps-11.zip - unzip gapps-11.zip 'Core/*' -d gapps-11 && rm gapps-11.zip - rm gapps-11/Core/setup* - lzip -d gapps-11/Core/*.lz - for f in gapps-11/Core/*.tar; do - tar -x --strip-components 2 -f "$f" -C gapps-11 + # Determine GAPPS date and API tag based on Android version. + case "$ANDROID_VERSION" in + 30) + GAPPS_DATE_FROM_VER="20220503"; GAPPS_API_TAG="11.0"; GAPPS_DIR="gapps-11" ;; + 31) + GAPPS_DATE_FROM_VER="20230105"; GAPPS_API_TAG="12.0"; GAPPS_DIR="gapps-12" ;; + 33) + GAPPS_DATE_FROM_VER="20220824"; GAPPS_API_TAG="13.0"; GAPPS_DIR="gapps-13" ;; + 34) + GAPPS_DATE_FROM_VER="20230601"; GAPPS_API_TAG="14.0"; GAPPS_DIR="gapps-14" ;; + *) + GAPPS_DATE_FROM_VER="20220503"; GAPPS_API_TAG="11.0"; GAPPS_DIR="gapps-11" ;; + esac + + # Allow override via GAPPS_VERSION, but keep defaults aligned with ANDROID_VERSION. + if [[ "$GAPPS_VERSION" =~ ^[0-9]+$ ]]; then + if [ "$GAPPS_VERSION" -ge 12 ]; then + GAPPS_API_TAG="12.0"; GAPPS_DATE_FROM_VER="20230105"; GAPPS_DIR="gapps-12" + fi + fi + + OPEN_GAPPS_ARCHIVE="open_gapps-x86_64-${GAPPS_API_TAG}-pico-${GAPPS_DATE_FROM_VER}.zip" + GAPPS_URL="https://sourceforge.net/projects/opengapps/files/x86_64/${GAPPS_DATE_FROM_VER}/${OPEN_GAPPS_ARCHIVE}/download" + ZIP_FILE="gapps-${GAPPS_API_TAG%%.*}.zip" + + wget "$GAPPS_URL" -O "$ZIP_FILE" + unzip "$ZIP_FILE" 'Core/*' -d "$GAPPS_DIR" && rm "$ZIP_FILE" + rm -f "$GAPPS_DIR/Core/setup*" || true + lzip -d "$GAPPS_DIR/Core/*.lz" || true + for f in "$GAPPS_DIR/Core/*.tar"; do + tar -x --strip-components 2 -f "$f" -C "$GAPPS_DIR" done - adb push gapps-11/etc /system - adb push gapps-11/framework /system - adb push gapps-11/app /system - adb push gapps-11/priv-app /system - rm -r gapps-11 + adb push "$GAPPS_DIR/etc" /system + adb push "$GAPPS_DIR/framework" /system + adb push "$GAPPS_DIR/app" /system + adb push "$GAPPS_DIR/priv-app" /system + rm -r "$GAPPS_DIR" || true touch /data/.gapps-done } install_root() { adb wait-for-device echo "Root Script Starting..." - # Root the AVD by patching the ramdisk. + # Root the AVD by patching the ramdisk for the configured Android version. git clone https://gitlab.com/newbit/rootAVD.git pushd rootAVD sed -i 's/read -t 10 choice/choice=1/' rootAVD.sh - ./rootAVD.sh system-images/android-30/default/x86_64/ramdisk.img - cp /opt/android-sdk/system-images/android-30/default/x86_64/ramdisk.img /data/android.avd/ramdisk.img + # Use the dynamic Android version for ramdisk patching + ./rootAVD.sh system-images/android-${ANDROID_VERSION}/default/x86_64/ramdisk.img + cp /opt/android-sdk/system-images/android-${ANDROID_VERSION}/default/x86_64/ramdisk.img /data/android.avd/ramdisk.img popd echo "Root Done" sleep 10 @@ -102,7 +132,7 @@ if [ -f /data/.first-boot-done ]; then fi echo "Init AVD ..." -echo "no" | avdmanager create avd -n android -k "system-images;android-30;default;x86_64" +echo "no" | avdmanager create avd -n android -k "system-images;android-${ANDROID_VERSION};default;x86_64" [ "$gapps_needed" = true ] && install_gapps && [ "$root_needed" = false ] && adb reboot [ "$root_needed" = true ] && install_root From bf2173b6ba2168f1a2fd6779a8fc3bbaa175f8ac Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Fri, 3 Apr 2026 08:42:44 +0000 Subject: [PATCH 02/14] feat: add Android 15 and 16 support - Add API 35 (Android 15) and API 36 (Android 16) support - Update GAPPS mapping for newer Android versions - Update README documentation --- README.md | 2 +- first-boot.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d8b515f..7648a86 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ scrcpy -s localhost:5555 | `SCREEN_DENSITY` | Screen pixel density in DPI | device default | | `ROOT_SETUP` | Set to `1` to enable rooting and Magisk. Can be turned on after the first start but cannot be undone without recreating the data volume. | `0` | | `GAPPS_SETUP` | Set to `1` to install PICO GAPPS. Can be turned on after the first start but cannot be undone without recreating the data volume. | `0` | -| `ANDROID_VERSION` | Android API version to emulate (30 = Android 11, 31 = Android 12, 33 = Android 13, 34 = Android 14). Also enables multi-version support. | `30` | +| `ANDROID_VERSION` | Android API version to emulate (30 = Android 11, 31 = Android 12, 33 = Android 13, 34 = Android 14, 35 = Android 15, 36 = Android 16). Also enables multi-version support. | `30` | | `GAPPS_VERSION` | GAPPS version to download. Default behavior derives from ANDROID_VERSION. | `11` | diff --git a/first-boot.sh b/first-boot.sh index f7cbfe0..061be77 100755 --- a/first-boot.sh +++ b/first-boot.sh @@ -58,6 +58,10 @@ install_gapps() { GAPPS_DATE_FROM_VER="20220824"; GAPPS_API_TAG="13.0"; GAPPS_DIR="gapps-13" ;; 34) GAPPS_DATE_FROM_VER="20230601"; GAPPS_API_TAG="14.0"; GAPPS_DIR="gapps-14" ;; + 35) + GAPPS_DATE_FROM_VER="20240415"; GAPPS_API_TAG="15.0"; GAPPS_DIR="gapps-15" ;; + 36) + GAPPS_DATE_FROM_VER="20250105"; GAPPS_API_TAG="16.0"; GAPPS_DIR="gapps-16" ;; *) GAPPS_DATE_FROM_VER="20220503"; GAPPS_API_TAG="11.0"; GAPPS_DIR="gapps-11" ;; esac From 03a2da8552ec7eeee63305bbdc8397527b506e8d Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Tue, 7 Apr 2026 05:01:17 +0000 Subject: [PATCH 03/14] fix: use google_apis system image for Android 35+ Android 35+ doesn't have default system images available. Switch to google_apis variant for API 35 and above. --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4bbd26e..901fef6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,12 @@ RUN mkdir /root/.android/ && \ # Detect architecture and set environment variable -RUN yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" "platform-tools" "platforms;android-${ANDROID_VERSION}" "system-images;android-${ANDROID_VERSION};default;x86_64" +RUN export ANDROID_VERSION=$ANDROID_VERSION && \ + if [ "$ANDROID_VERSION" -ge 35 ]; then \ + yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" "platform-tools" "platforms;android-${ANDROID_VERSION}" "system-images;android-${ANDROID_VERSION};google_apis;x86_64"; \ + else \ + yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" "platform-tools" "platforms;android-${ANDROID_VERSION}" "system-images;android-${ANDROID_VERSION};default;x86_64"; \ + fi # remove /opt/android-sdk/emulator/crashpad_handler RUN rm -f /opt/android-sdk/emulator/crashpad_handler # RUN if [ "$(uname -m)" = "aarch64" ]; then \ From 4e26078812b16843da13613a465bfe536a157397 Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Tue, 7 Apr 2026 05:03:41 +0000 Subject: [PATCH 04/14] fix: skip emulator install for Android 35+ to avoid package not found error --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 901fef6..d594d6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,7 +48,8 @@ RUN mkdir /root/.android/ && \ # Detect architecture and set environment variable RUN export ANDROID_VERSION=$ANDROID_VERSION && \ if [ "$ANDROID_VERSION" -ge 35 ]; then \ - yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" "platform-tools" "platforms;android-${ANDROID_VERSION}" "system-images;android-${ANDROID_VERSION};google_apis;x86_64"; \ + yes | sdkmanager --sdk_root=$ANDROID_HOME "platform-tools" "platforms;android-${ANDROID_VERSION}" "system-images;android-${ANDROID_VERSION};google_apis;x86_64" || true; \ + yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" || true; \ else \ yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" "platform-tools" "platforms;android-${ANDROID_VERSION}" "system-images;android-${ANDROID_VERSION};default;x86_64"; \ fi From ee518e953be5e256719079ce4eb71141b7822cc3 Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Tue, 7 Apr 2026 05:05:10 +0000 Subject: [PATCH 05/14] fix: always try to install emulator package separately --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d594d6f..f5ef6ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,10 +49,10 @@ RUN mkdir /root/.android/ && \ RUN export ANDROID_VERSION=$ANDROID_VERSION && \ if [ "$ANDROID_VERSION" -ge 35 ]; then \ yes | sdkmanager --sdk_root=$ANDROID_HOME "platform-tools" "platforms;android-${ANDROID_VERSION}" "system-images;android-${ANDROID_VERSION};google_apis;x86_64" || true; \ - yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" || true; \ else \ yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" "platform-tools" "platforms;android-${ANDROID_VERSION}" "system-images;android-${ANDROID_VERSION};default;x86_64"; \ - fi + fi && \ + yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" || true # remove /opt/android-sdk/emulator/crashpad_handler RUN rm -f /opt/android-sdk/emulator/crashpad_handler # RUN if [ "$(uname -m)" = "aarch64" ]; then \ From a7a8d31dee8f9e1be44f4f7077617e07a0317fce Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Tue, 7 Apr 2026 05:09:33 +0000 Subject: [PATCH 06/14] trigger fresh build From 3233a5b83631149533514903c0767a6f9cec7616 Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Tue, 7 Apr 2026 05:16:49 +0000 Subject: [PATCH 07/14] fix: download emulator directly instead of relying on sdkmanager --- Dockerfile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f5ef6ab..35d4ee8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,10 +16,21 @@ RUN apt-get update && \ qemu-kvm \ iproute2 \ socat \ - tzdata && \ + tzdata \ + squashfs-tools && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* +# Download emulator directly as fallback (sdkmanager doesn't always provide it) +RUN mkdir -p /opt/android-sdk && \ + cd /opt/android-sdk && \ + wget -q "https://dl.google.com/android/repository/emulator-linux_x64-11076708_latest.zip" -O emulator.zip || true && \ + if [ -f emulator.zip ]; then \ + unzip -q emulator.zip && rm emulator.zip; \ + else \ + echo "Warning: Failed to download emulator, will install via sdkmanager"; \ + fi + # Set up Android SDK RUN mkdir -p /opt/android-sdk/cmdline-tools && \ cd /opt/android-sdk/cmdline-tools && \ From 0cb070fc8cafec78c27cf0499f6d25c18a6bcc0b Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Tue, 7 Apr 2026 05:18:47 +0000 Subject: [PATCH 08/14] fix: dynamically fetch latest emulator from SDK repository XML --- Dockerfile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 35d4ee8..c76888a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,14 +21,12 @@ RUN apt-get update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* -# Download emulator directly as fallback (sdkmanager doesn't always provide it) -RUN mkdir -p /opt/android-sdk && \ - cd /opt/android-sdk && \ - wget -q "https://dl.google.com/android/repository/emulator-linux_x64-11076708_latest.zip" -O emulator.zip || true && \ - if [ -f emulator.zip ]; then \ - unzip -q emulator.zip && rm emulator.zip; \ - else \ - echo "Warning: Failed to download emulator, will install via sdkmanager"; \ +RUN curl -s "https://dl.google.com/android/repository/repository2-1.xml" | \ + grep -oP 'emulator-linux_x64-\d+\.zip' | head -1 | \ + awk '{print "https://dl.google.com/android/repository/" $0}' | \ + wget -q -O /tmp/emulator.zip - || true && \ + if [ -s /tmp/emulator.zip ] && [ -f /tmp/emulator.zip ]; then \ + unzip -q /tmp/emulator.zip -d /opt/android-sdk && rm /tmp/emulator.zip; \ fi # Set up Android SDK From 6d171ef9629bc86f9e0c214ccba29b27efa9c644 Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Tue, 7 Apr 2026 05:29:31 +0000 Subject: [PATCH 09/14] fix: install platform-tools first for adb healthcheck --- Dockerfile | 54 +++++++++++++----------------------------------------- 1 file changed, 13 insertions(+), 41 deletions(-) diff --git a/Dockerfile b/Dockerfile index c76888a..d4c23cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,6 @@ FROM ubuntu:20.04 ARG ANDROID_VERSION=30 ENV ANDROID_VERSION=${ANDROID_VERSION} -# Install necessary packages RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ libegl1 \ @@ -29,7 +28,6 @@ RUN curl -s "https://dl.google.com/android/repository/repository2-1.xml" | \ unzip -q /tmp/emulator.zip -d /opt/android-sdk && rm /tmp/emulator.zip; \ fi -# Set up Android SDK RUN mkdir -p /opt/android-sdk/cmdline-tools && \ cd /opt/android-sdk/cmdline-tools && \ wget https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip -O cmdline-tools.zip && \ @@ -40,67 +38,41 @@ RUN mkdir -p /opt/android-sdk/cmdline-tools && \ ENV ANDROID_HOME=/opt/android-sdk ENV ANDROID_AVD_HOME=/data -ENV ADB_DIR="$ANDROID_HOME/platform-tools" -ENV PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ADB_DIR:$PATH" +ENV PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH" -# Initializing the required directories. RUN mkdir /root/.android/ && \ - touch /root/.android/repositories.cfg && \ - mkdir /data && \ + touch /root/.android/repositories.cfg && \ + mkdir /data && \ mkdir /extras -# Copy emulator.zip -#COPY emulator.zip /root/emulator.zip -#COPY emulator/package.xml /root/package.xml - - -# Detect architecture and set environment variable RUN export ANDROID_VERSION=$ANDROID_VERSION && \ + yes | sdkmanager --sdk_root=$ANDROID_HOME "platform-tools" && \ if [ "$ANDROID_VERSION" -ge 35 ]; then \ - yes | sdkmanager --sdk_root=$ANDROID_HOME "platform-tools" "platforms;android-${ANDROID_VERSION}" "system-images;android-${ANDROID_VERSION};google_apis;x86_64" || true; \ + yes | sdkmanager --sdk_root=$ANDROID_HOME "platforms;android-${ANDROID_VERSION}" "system-images;android-${ANDROID_VERSION};google_apis;x86_64" || true; \ else \ - yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" "platform-tools" "platforms;android-${ANDROID_VERSION}" "system-images;android-${ANDROID_VERSION};default;x86_64"; \ + yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" "platforms;android-${ANDROID_VERSION}" "system-images;android-${ANDROID_VERSION};default;x86_64"; \ fi && \ yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" || true -# remove /opt/android-sdk/emulator/crashpad_handler + +RUN if [ ! -f "$ANDROID_HOME/platform-tools/adb" ]; then \ + echo "ERROR: adb not found at $ANDROID_HOME/platform-tools/adb"; \ + ls -la $ANDROID_HOME/; \ + exit 1; \ + fi + RUN rm -f /opt/android-sdk/emulator/crashpad_handler -# RUN if [ "$(uname -m)" = "aarch64" ]; then \ -# unzip /root/emulator.zip -d $ANDROID_HOME && \ -# mv /root/package.xml $ANDROID_HOME/emulator/package.xml && \ -# rm /root/emulator.zip && \ -# yes | sdkmanager --sdk_root=$ANDROID_HOME "platform-tools" "platforms;android-29" "system-images;android-29;default;arm64-v8a" && \ -# echo "no" | avdmanager create avd -n test -k "system-images;android-29;default;arm64-v8a"; \ -# else \ -# yes | sdkmanager --sdk_root=$ANDROID_HOME "emulator" "platform-tools" "platforms;android-29" "system-images;android-29;default;x86_64" && \ -# echo "no" | avdmanager create avd -n test -k "system-images;android-29;default;x86_64"; \ -# fi -# Copy supervisor config COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf -# Copy the rootAVD repository -#COPY rootAVD /root/rootAVD - -# Copy the first-boot script COPY first-boot.sh /root/first-boot.sh RUN chmod +x /root/first-boot.sh -# Copy the start-emulator script COPY start-emulator.sh /root/start-emulator.sh RUN chmod +x /root/start-emulator.sh -# Expose necessary ports EXPOSE 5554 5555 -# Healthcheck to ensure the emulator is running HEALTHCHECK --interval=10s --timeout=10s --retries=600 \ CMD adb devices | grep emulator-5554 && test -f /data/.first-boot-done || exit 1 -# Start Supervisor to manage the emulator CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] - -# docker build -t dockerify-android . -# docker run -d --name dockerify-android --device /dev/kvm --privileged -p 5555:5555 dockerify-android -# docker run -d --name dockerify-android --device /dev/kvm --privileged -p 5555:5555 shmayro/dockerify-android -# docker exec -it dockerify-android tail -f /var/log/supervisor/emulator.out -# docker exec -it dockerify-android tail -f /var/log/supervisor/first-boot.out.log From 13d9b14109b917302a9d4a6b31caa9deae8fe270 Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Tue, 7 Apr 2026 05:31:16 +0000 Subject: [PATCH 10/14] fix: install adb from Ubuntu for ARM support --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d4c23cc..cb6545a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,8 @@ RUN apt-get update && \ iproute2 \ socat \ tzdata \ - squashfs-tools && \ + squashfs-tools \ + adb && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* From 4f37a86af1aef8935fec9afb32a9ebfb497ae44e Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Tue, 7 Apr 2026 05:40:04 +0000 Subject: [PATCH 11/14] fix: use simpler healthcheck that works on ARM --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index cb6545a..0bd5d12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ RUN mkdir -p /opt/android-sdk/cmdline-tools && \ ENV ANDROID_HOME=/opt/android-sdk ENV ANDROID_AVD_HOME=/data -ENV PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH" +ENV PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$PATH:$ANDROID_HOME/platform-tools" RUN mkdir /root/.android/ && \ touch /root/.android/repositories.cfg && \ @@ -73,7 +73,7 @@ RUN chmod +x /root/start-emulator.sh EXPOSE 5554 5555 -HEALTHCHECK --interval=10s --timeout=10s --retries=600 \ - CMD adb devices | grep emulator-5554 && test -f /data/.first-boot-done || exit 1 +HEALTHCHECK --interval=30s --timeout=10s --retries=60 \ + CMD ps aux | grep -v grep | grep -q emulator || test -f /data/.first-boot-done CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] From 10cbeeaaeb3257ee0252f14c1af4e9a4f970f67a Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Wed, 8 Apr 2026 06:20:31 +0000 Subject: [PATCH 12/14] fix: add procps for healthcheck and explicit healthcheck in compose --- Dockerfile | 3 ++- docker-compose.yml | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0bd5d12..214d25e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,8 @@ RUN apt-get update && \ socat \ tzdata \ squashfs-tools \ - adb && \ + adb \ + procps && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/docker-compose.yml b/docker-compose.yml index 1609f4f..a32fc31 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,6 +25,12 @@ services: privileged: true devices: - /dev/kvm + healthcheck: + test: ["CMD", "ps", "aux"] + interval: 30s + timeout: 10s + retries: 60 + start_period: 60s scrcpy-web: container_name: scrcpy-web From 5bfd6ff92e26b1757be14f2a4a969ae168c374b5 Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Wed, 8 Apr 2026 06:26:36 +0000 Subject: [PATCH 13/14] fix: use correct Ubuntu 20.04 package names (lzip->xz-utils, supervisor->python3-supervisor) --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 214d25e..3a7980d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,15 +9,14 @@ RUN apt-get update && \ wget \ curl \ git \ - lzip \ + xz-utils \ unzip \ - supervisor \ + python3-supervisor \ qemu-kvm \ iproute2 \ socat \ tzdata \ squashfs-tools \ - adb \ procps && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* From e6035bd65e7948540af3edfe9f1b5bf371f70870 Mon Sep 17 00:00:00 2001 From: cloudwaddie Date: Wed, 8 Apr 2026 06:36:51 +0000 Subject: [PATCH 14/14] fix: revert supervisor to original name (works on ARM) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3a7980d..263b62f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update && \ git \ xz-utils \ unzip \ - python3-supervisor \ + supervisor \ qemu-kvm \ iproute2 \ socat \