Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker on embedded systems, why not?

There was a project thrown my way recently that involves the orchestration of several (Linux capable) embedded devices, deploying software to them, and allowing for the applications to be updated when the code base updates in a git repo.

The initial thought was to make a standard image for each device, and I set out, attempting to install docker on an UDOO Quad and an Intel Edison to start, but without any success up to this point.

My thinking is that it seems to be a good idea to install Docker on embedded devices--but if that's the case, surely it would have been ported by now. The only group out there that seems to be making these efforts is Resin.io.

Is there something I'm missing, or is there a clear reason why Docker doesn't make sense on embedded devices? If there isn't a reason, and it does make sense to run Docker on embedded systems, is there something I've overlooked out there: are there any sources of discussion on porting, or how-to's that cover this?

like image 579
Bobby Avatar asked Dec 01 '15 00:12

Bobby


People also ask

Is Docker good for embedded systems?

Docker is a useful tool for embedded teams who are looking to simplify the build environments and build out a DevOps process. Over the last several years, Docker has taken the software industry by storm. Docker provides developers an “open platform for developing, shipping, and running applications”.

Is there a reason not to use Docker?

Common reasons not to use Docker include the following: Security considerations. Applications that require strict isolation are better deployed in VMs than in containers, which don't isolate applications fully from each other or the host OS. GUI applications.

What are the disadvantages of Docker?

Docker has few disadvantages like lack of GUI, command-line operations, and much more which are questioned by developers. Docker finds its way into real world applications with its advantages.


2 Answers

I have considered running docker on embedded devices (a mips system), but didn't go that way. There are some problems with it, in my humble view:

  1. Docker is implemented in Golang. There is currently no available tool chain for mips to compile go. You will need to create the tool chain yourself using gcc-go.

  2. The size of docker is larger than lxc. In a desktop computer this is not a problem, but the embedded device has limited flash storage.

  3. Docker uses some quite up-to-date feature of linux kernel. Sometimes the kernel version on embedded devices are not so new and back-port is needed to make it work.

  4. The docker image has to be built on the same architecture as the run time environment. It means that if you want to run a docker container on Raspberry Pi, the docker image has to be built on an ARM-architecture system. QEMU can be used to build docker image in the cloud, but it doesn't support all CPU architectures used in embedded system. (for example, it currently doesn't support MIPS)

In the end, lxc was chosen for the specific task of running a container on embedded device. It has limited features compared to docker, but currently it suits the requirement of the project.

As of year 2019, I would like to update this answer since I did port docker to embedded system with ARM cpu. With the price of flash usage, memory usage, by using docker you will have container management, image management, and many ready to run images from docker hub. So the decision is a balance between cost and features.

like image 94
Jing Qiu Avatar answered Oct 04 '22 09:10

Jing Qiu


Here is an update for 2018:

You can work with Docker on embedded devices such as Raspberry Pi and Orange Pi quite easily now because of advancements in the development of Raspbian and Armbian operating system images. Specifically, both types of devices and their respective OS images now support kernels that are of sufficiently high enough versions to install Docker without any problems (at least version 3.10, though both now offer 4.x+ versions).

Your desire for faster rates of change can definitely be realized by using embedded Docker. I can say from experience that I have tested and regularly run the approach you describe. Basically, you start with a base operating system image such as Raspbian or Armbian, tweak that operating system enough that it's secure and has Docker installed, and then you use Docker for handling development iteration and application updates.

As an aside, if you are interested in running Docker on embedded Linux devices, then I recommend you check out a free, open-source, MIT-licensed command line tool I wrote to help developers work with embedded Docker on multiple devices at once: https://github.com/ForwardLoopLLC/floopcli .

Even if you are not interested in the tool itself, the documentation for the tool describes several patterns for working with Dockerized applications across multiple devices in multiple languages: https://docs.forward-loop.com/floopcli/master/index.html . The materials there should serve as a starting point for porting applications to Docker and then deploying them on embedded devices. The documentation also addresses some embedded device subtleties, such as differences between ARMv6 and ARMv7. Hopefully this helps you get started!

like image 29
Nick Settje Avatar answered Oct 04 '22 11:10

Nick Settje