Live data from Hacker News

Android in Docker without QEMU/emulator

github.com

11–20 of 72 posts

Re: Android in Docker without QEMU/emulator

#11
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?

Re: Android in Docker without QEMU/emulator

#13
post #11

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 o…

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

adb or UIAutomator

Re: Android in Docker without QEMU/emulator

#14
post #8
post #3

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.

All Linux containers leak the host kernel no? The Anbox project relies on the exact same 2 modules: https://docs.anbox.io/userguide/install_kernel_modules.html . While these are "android-specific", they are present in the linux kernel tree, and even come pre-installed in Ubuntu 19.04 (and probably more distros).

> All Linux containers leak the host kernel no?

Curious in what way?

Re: Android in Docker without QEMU/emulator

#15
post #11

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 o…

This one specifically seems to run Android in the Linux Kernel using the usual suspects of container tech. It should have next to zero performance impact so it will definitely have better performance compared to the default Android emulator considering that's using qemu, even if it's qemu-kvm.

Whether it's as reliable as running a VM, is something that'll need to be tested. Personally I got an error when trying to exit out of the shell (and thus was unable to exit), something I've never seen in the VM version of Android.

Re: Android in Docker without QEMU/emulator

#17
post #8
post #3

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.

All Linux containers leak the host kernel no? The Anbox project relies on the exact same 2 modules: https://docs.anbox.io/userguide/install_kernel_modules.html . While these are "android-specific", they are present in the linux kernel tree, and even come pre-installed in Ubuntu 19.04 (and probably more distros).

Not all linux kernel leak to host. Docker security is way better than nefore. And there also projects like podman and docker unprivileged that don't require any root intraction to set up a kernel

Re: Android in Docker without QEMU/emulator

#18
post #4

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.

That Dockerfile is just an image to _build_ the Android container

See instructions to build it (or pull the published version)

https://github.com/remote-android/redroid-doc/tree/master/an...

Then you can run the Android container

Re: Android in Docker without QEMU/emulator

#19
post #8

Earlier quoted context omitted.

All Linux containers leak the host kernel no? The Anbox project relies on the exact same 2 modules: https://docs.anbox.io/userguide/install_kernel_modules.html . While these are "android-specific", they are present in the linux kernel tree, and even come pre-installed in Ubuntu 19.04 (and probably more distros).

> All Linux containers leak the host kernel no? Curious in what way?

See any explanation of what a linux container is[0]. Containers in linux are a patchwork of various features that "contain" a process group in different ways while sharing the kernel with the rest of the system.

Running either of

    docker run --rm --entrypoint /bin/uname alpine:latest -a
or

    uname -a
gives you the same kernel version. The only difference will be in the hostname.

[0]: https://embeddedbits.org/introduction-linux-containers/

Re: Android in Docker without QEMU/emulator

#20
post #17
post #8

Earlier quoted context omitted.

All Linux containers leak the host kernel no? The Anbox project relies on the exact same 2 modules: https://docs.anbox.io/userguide/install_kernel_modules.html . While these are "android-specific", they are present in the linux kernel tree, and even come pre-installed in Ubuntu 19.04 (and probably more distros).

Not all linux kernel leak to host. Docker security is way better than nefore. And there also projects like podman and docker unprivileged that don't require any root intraction to set up a kernel

Depends on your definition of "leak" I suppose. You can't get a different kernel version inside a container so there must be a "leak" in some sense. Reducing capabilities etc will just leak lesser information about the system in general, but your kernel is always shared.
Post reply on HN