ResinOS: step up your container game on Raspberry PI

Docker Logo

In the past we’ve seen how to install Docker on a Raspberry PI using the native Raspbian operating system. Today let’s take a look at a more advanced option: ResinOS.

Why ResinOS?

ResinOS is a lightweight operating system tailored for containers that runs on a variety of ARM boards. It is essentially an operating system that enables you to run Docker containers on your ARM board out of the box, no complex Docker installations. Everything is already set up for you and you also have a nifty command-line called resin-cli that will help you from the early stage of setting up your board, to the final stages such as deploying your project.

On top of that since version 2.9.0, ResinOS uses balena.io as an alternative Container Engine. Balena is a container engine optimized for low-memory device such as ARM boards. It uses less memory, uses image deltas by default (read: no need to re-download huge layers) and prevents pesky pitfalls such as corrupted layers due to power failures and similar events. Balena should essentially be the same as the Docker Engine but there are a few features missing such as Docker Swarm.

Installing Resin-cli (optional, recommended)

Important
I take absolutely NO responsibility of what you do with your machine; use this tutorial as a guide and remember you can possibly cause data loss if you touch things carelessly.

Without further discussion let’s dive into the first step: installing resin-cli. In this step you will install resin-cli on your machine, not the target machine for ResinOS. This step is by no mean required, but it will simplify your life a lot.

First let’s talk about requirements:

If you have all the requirements you can simply do:

Getting and configuring the image (resin-cli)

Now that you got the image you configure it using the resin-cli:

Configuring the image (without resin-cli)

If you don’t want to use the resin-cli, you can simply mount the image or burn the image on a micro SD card and modify the following files:

/boot/config.json:

/boot/system-connections/resin-sample:

Simply modify these parameters mainly related to wi-fi, in order to get the desired result. PersistentLogging is great, but it may slow down and saturate your micro SD card, hence it is advised to keep it off.

Burning the image (resin-cli)

Resin-cli makes the process of burning the image super-easy:

You can now safely remove the micro SD card and boot your Raspberry PI.

Burning the image (without resin-cli)

You can follow this guide and burn your image onto the micro SD card.

You can now safely remove the micro SD card and boot your Raspberry PI.

All done! BONUS: try your first project (resin-cli required)

In this final step you will harness the power and the usability of the resin-cli. On your machine (not on the Raspberry) do:

This will pull a git repo containing a “hello world”, build the image and run it on your Raspberry Pi.

Image courtesy of mark | marksei

The following two tabs change content below.
The IT guy with a little boredom look in his eyes, fond of computers since forever he now works as a freelancer in the IT and shares his experiences through this blog.

You may also like...