from Hacker News

Android in Docker without QEMU/emulator

by PascalW on 1/4/22, 10:32 AM with 71 comments

  • by PascalW on 1/4/22, 10:35 AM

    Came across this very useful project. It provides Docker images with Android running directly in Docker, without qemu or an emulator. I've never seen this before, all other solutions that I'm aware of either run the Android emulator in Docker or use qemu directly (like Anbox).

    Advantage of this is that it's very lightweight and does not require VT-X or AMD-V, ideal for running in cloud environments that typically do not expose this CPU capability.

  • by pengaru on 1/4/22, 5:41 PM

    What exactly is Docker enabling here beyond a Docker workflow, which is quite orthogonal to the presence of a vm or emulator?

    Isn't the enabling technology here just kernel-level android bits? Docker is fluff, yet ends up dominating the headline.

  • by 0x0 on 1/4/22, 11:24 AM

    Interesting concept but seems to require custom android-specific kernel modules (ashmem, binderfs), which means the android containers aren't very containerized but leak into the host kernel.
  • by marcodiego on 1/4/22, 1:22 PM

    Don't forget waydroid: https://waydro.id/ . Last time I tried, it worked reasonably well.
  • by cranx on 1/4/22, 2:53 PM

    This is interesting, but I don’t see this as something for use in development of Android apps. Given all Android’s quarks and fragmentation the use of real devices and Google’s emulators will provide a better surface to catch bugs during dev. What’s the primary use case for these containerized versions of Android?
  • by wwwhizz on 1/4/22, 1:25 PM

    required params (already added in docker image)

        qemu=1
    
    How is that without qemu?
  • by drran on 1/4/22, 12:37 PM

    Will it work on WSL? It can be a good way to run Android on Windows.
  • by jeroenhd on 1/4/22, 11:27 AM

    How is this accomplished? Is this using Anbox or something similar I don't understand how the Dockerfiles linked here end up running an instance of Android.
  • by fareesh on 1/4/22, 12:34 PM

    For development work I use the default Android emulator that comes with Android Studio.

    Are any of these ones superior in terms of performance, resource utilization, etc? The cloud angle is mildly interesting although in my specific use-case I'd probably just end up paying for a service that can provide access to emulators in the cloud.

    Is there more scope to do things like automating inputs etc this way? How would one go about that?

  • by exdsq on 1/4/22, 6:28 PM

    Trying to fix some Rust docker builds that are being killed by QEMU on Apple Silicon right now. I always believed Docker was cross platform, I had no idea how much of a pain it can be to use with buildx and --platform to get stuff working. SIGSEGV errors at random points, non-deterministic errors, GAH!
  • by Tepix on 1/4/22, 12:59 PM

    This could be useful for running WhatsApp inside a vm instead of your phone for those rare instances where it is needed.
  • by goodpoint on 1/4/22, 4:15 PM

    I'd rather use waydroid to avoid the attack surface of docker and its complexity.
  • by junon on 1/4/22, 4:59 PM

    Perhaps a simple question, but... why?