DEV Community

Konstantin
Konstantin

Posted on • Edited on • Originally published at konstantin.io

1

Using raspberry as gitlab runner(with docker)

With an introduction of USB boot option to Raspberry you can use it with an external SSD drive, so you don't need to switch broken SD cards from time to time and reconfigure the whole system.

And with SSD installed raspberry becomes an interesting option to use as an external gitlab runner.

Now, as an executor you will probably choose docker since it allows you to run any software that you want in without having to install it on your Raspberry.

But there is a catch

Since Raspberry doesn't have x64 CPU but rather ARMvX you will find that some of your gitlab jobs will fail with a following log:

standard_init_linux.go:190: exec user process caused "exec format error"
standard_init_linux.go:190: exec user process caused "exec format error"
ERROR: Job failed: exit code 1
Enter fullscreen mode Exit fullscreen mode

That means that you have to go onto your raspberry and build your image locally like so:

docker build -t node .
Enter fullscreen mode Exit fullscreen mode

provided that you have a Dockerfile prepared:

FROM node:8
Enter fullscreen mode Exit fullscreen mode

And then you need to tell your docker executor to use local image instead of one from Dockerhub:

[[runners]]
  name = "raspberrypi"
  ...
  executor = "docker"
  [runners.docker]
    ...
    pull_policy = "if-not-present"
Enter fullscreen mode Exit fullscreen mode

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay