Building the dart sdk for armv6 via Docker

May 05, 2018

Given the rising popularity of Flutter I wanted to play around with the underlying language and it’s sdk, Dart.

More specifically I wanted to use Dart on my Raspberry Pi Zero.

The official binaries of Dart VM / SDK support only ArmV7 which means Raspberry Pi 2 onward, as the Zero is ArmV6.

In the Dart Github there are some instructions on how to build the sdk, also for the Raspberry Pi 1, but those instructions seems to be outdated and they doesn’t cover my preferred Linux distribution, Archlinux.

So I decided to create a Dockerfile to use Docker to build the dart sdk for armv6, so that I can base my image on Debian and run it on any OS that supports Docker.

You can find the Dockerfile in my github repo:

There you will also find the instructions on how to build and retrieve the binaries, in the README.

Anyway the instructions consist in building the docker image:

docker build .

Then retrieve the .zip with the binaries from the image:

docker images<br /> docker create IMAGE_ID<br /> docker cp CONTAINER_ID:/ .

At that point you can send the binaries to your Raspberry Pi Zero:

unzip<br /> scp -r dart-sdk

And once you set the PATH, you can try out Dart with the given test files: