Easier than Expected: Raspberry Pi Docker Images

2020-06-17

A few days ago I received a request from someone who wanted to run k8s-ecr-login-renew on a Raspberry Pi Kubernetes cluster. Fortunately, I already had experience building Go apps for that architecture. But what I really had no clue about was the next step: putting that executable into a Docker image.

Looking around online, I found a few articles that recommended installing an experimental version of Docker, and then running the docker buildx... command to build for different platforms. I also found that the Alpine image in Docker Hub has published ARM-based versions. I don't know why, but I decided to just try building an image without installing the experimental feature. I'm happy I did that, because it turned out to be quite easy to build. Here's how I did it:

You can see this all in action in the Dockerfile-arm file in the project repo.

And that is it, super easy!