8

Wherever I search, I can't find any resources on how to run Docker on an iOS device.

Is iOS a valid host OS for Docker?

9

Docker is an automation tool, which facilitates deployment of applications using Linux feature called Linux Containers. Docker provides neither virtualization nor emulation environments. As of today, running Docker containers requires using Linux (support for other operating systems, like Oracle Solaris and Windows Server is in the development phase).

Docker for Mac and Docker for Windows are separate products that run a Linux virtual machine inside the host OS and provision containers inside that machine.

There is no way of running a Linux virtual machine in iOS, hence iOS cannot be a "host for Docker".

Besides operating system, even if you ran Linux on iOS, you would need to also consider the CPU (that is also true for Raspberry Pi recommended in the comments under the other answer). Most available Docker images use binary packages for Intel/AMD architecture, not ARM limiting the use cases compared to running it on MacBook.

2
  • 1
    "There is no way of running Docker containers on operating system other than Linux." This is not true; Docker also runs on Solaris, for example, where it leverages Zones -- a container-like virtualisation feature that predates Linux containers.
    – calum_b
    Aug 29 '16 at 12:59
  • That's true, also Windows Server. But either is not officially released yet, afaik. Changed the wording, thx.
    – techraf
    Aug 29 '16 at 13:14
2

Actually, you can run Linux on iOS and therefore you can run Docker. There's an app called UTM that I've recently been working with and have been quite surprised by what I've been able to do on my iPad Pro 11 2nd Gen.

The app does NOT require jailbreaking. In iOS 11-13, it just needs to be side-loaded since it isn't an appstore app (not surprising). On iOS 14, Apple patched the trick that was used to get JIT working. As a result, the next best workaround is significantly more involved. You can find those instructions here. But even then, you still do not need to jailbreak the device. As to why it isn't just in the appstore, according to the developers of UTM:

Apple does not permit any apps that have interpreted or generated code therefore it is unlikely that UTM will ever be allowed. However, there are various ways people on the internet have come up to sideload apps without requiring a jailbreak. We do not condone or support any of these methods.

This is just doing the exact same thing that Docker Desktop does for multi-arch images for Windows and Mac OS - utilizing LinuxKit, buildx and qemu. It is Open Source, however, so you can view the code to ensure it's safe and build out the app yourself. The site for the app is getutm.app. The source is on GitHub in utmapp/UTM.

The readme in the repository as well as the info on the site are detailed and easy to follow. There are multiple prebuilt VMs available here for several different Linux versions:

  • Arch Linux ARM
  • Debian 10.4 (osy's developer edition) ARM
  • Debian 10.4 (LDXE) ARM
  • Debian 10.4 (Xfce) ARM
  • Debian 10.4 (minimal) ARM
  • Ubuntu 14.04
  • Ubuntu 18.04

There are also prebuilt images for Android(v2.2, v4.4 and v9.0) as well as ReactOS(v0.4.14), but this is specific to Docker, so the Linux versions are what I'm concentrating on.

Once you've installed UTM and then added your Linux machine (prebuilt or by creating your own image - details in the readme.md file in the repository above) just follow the instructions here

I assume, however, that it won't be long before there is a Docker Desktop release for iOS, as it's just a build with the XCode debugger attached (same as for MacOS). since Docker Desktop is available for Windows and Mac, however, you could just use a windows vm (Windows 10 for ARM actually runs well, considering. And it isn't just Windows RT ask over again! This is a FULL Windows 10 install that can run x86, ARM32 and ARM64 apps.) inside the UTM app running Windows 10 for ARM and the Docker Desktop for Windows and that way not only is Docket availabke within the iOS device, but you would be able too build out different images from there as well as do your docker build and deployment from inside it as well. But, if you're more comfortable on Linux, this is how you'd do it. Hopefully this will help someone.

1
  • We are surely at the cusp of amazing virtualization software on Apple silicon. It’s going to be a fun year to see if Apple catches up with Windows and their amazing WSL2 tech. The ESXi on Intel and Arm are really doing great work too.
    – bmike
    Oct 24 '20 at 18:18
0

iOS would be an extremely poor choice for docker use. Setting aside that code needs to be signed to run on iOS, these general design considerations raise problems to implement docker on iOS:

  • Apps don't run in background
  • memory is severely constrained
  • CPU is constrained
  • power is constrained

The iOS design makes running persistent server tasks difficult and in the end, wouldn't it make sense to run docker on a swarm of networked raspberry pi and just orchestrate the setup and configuration from iOS?

For that I run prompt and ssh into Linux or Mac hosts to set up docker instances and control them.

4
  • I see your point. My intention was to be even more productive on the go with an iPad to make my MacBook obsolete. Sometimes (often) I need a Terminal and with Docker I could run Ubuntu for professional stuff, while still having iOS for private stuff. Aug 28 '16 at 21:37
  • 3
    A hootoo wireless router, raspberry pi 3 and a 128 GB memory stick would set you back maybe $75 to program docker on a desert island. If there were cell coverage for the iPad, you're set, @Ecofritze
    – bmike
    Aug 28 '16 at 21:40
  • Doing so I would not need Docker since I could run anything I need directly on the Raspberry Pi. I'm just looking for a more elegant / simple / Apple-like solution. Aug 28 '16 at 21:49
  • For some people, an iPad is just not a suitable replacement for a Mac. I don't think you're going to be successful in your quest to run Ubuntu on your iPad as a guest OS.
    – samh
    Aug 28 '16 at 23:12
0

As of iOS 13, the operating system specifically disabled creating executable regions of memory and launching sub-processes for 3rd party applications. This makes applications like Docker somewhat technically impossible.

Unless the solution requires jailbreaking, which in turn fragile and creates other security risks.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .