Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to run containers on android devices?

I’m a mobile developer and recently adept at using containers with docker. I’m developing a container architecture for my graduate project. One of the modules of this architecture would need to be run on an android device. But I could not find information on how to run a container on an android device. It could be something simple like an alpine image with python.

Can anyone tell me if there is a possibility to run a container on an android device with docker, or even kubernetes?

like image 868
Thomas Marques Avatar asked Nov 28 '18 20:11

Thomas Marques


People also ask

Can a Docker container run on Android?

Yes, running docker is absolutely possible on Android, doing the same on my device. The only thing you need is a custom kernel with all required docker features activated - so be prepared to compile a kernel.

Can Containers run on any OS?

You can run both Linux and Windows programs and executables in Docker containers. The Docker platform runs natively on Linux (on x86-64, ARM and many other CPU architectures) and on Windows (x86-64). Docker Inc. builds products that let you build and run containers on Linux, Windows and macOS.

Do containers require an operating system?

Yes, they do. Every container is based on an OS image, e.g. Alpine, CentOS or Ubuntu. They just share the host kernel, but run every user-space process in a separate name space specific for that container.

Can Containers run on multiple OS?

No, Docker containers can't run on all operating systems directly, and there are reasons behind that. Let me explain in detail why Docker containers won't run on all operating systems. Docker container engine was powered by the core Linux container library (LXC) during the initial releases.


2 Answers

It is possible to use it for running docker on an android device using an application like termux or userland to install a qemu package.

The best way is to use alpine linux terminal, an android app available on github.

This alpine term app has a QEMU to run like alpine ISO. All things are automated and this works with x86_64 kernel on any android.

Some android phones have a KVM kernel so this device can run faster alpine term

Also my friends made a video on a YouTube channel to run docker on any android phone without root.

like image 118
vishawnath kokare Avatar answered Sep 27 '22 23:09

vishawnath kokare


In 2021, the answer is definitely yes.

Here is a tutorial on that topic, which shows you how to run docker directly on Android, without VMs nor chroot. Note that you do need to root your phone and build a custom kernel though.

If you only want a quick look of docker running on android without getting your hands dirty, check out this comment on GitHub.

like image 31
navigaid Avatar answered Sep 27 '22 22:09

navigaid