# Trouble building Tailscale for Pi 3B

**URL:** <https://forums.balena.io/t/trouble-building-tailscale-for-pi-3b/374909>\
**Category:** balenaOS\
**Tags:** raspberrypi3\
**Created:** [October 8, 2025, 5:23pm UTC](https://forums.balena.io/t/trouble-building-tailscale-for-pi-3b/374909 "2025-10-08T17:23:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![novice603](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/novice603/32/10515_2.png) [@novice603](https://forums.balena.io/u/novice603)\
**Post date:** [October 8, 2025, 5:23pm UTC](https://forums.balena.io/t/trouble-building-tailscale-for-pi-3b/374909/1 "2025-10-08T17:23:23Z")

</div>

I’ve got BalenaOS and Anthias installed on a Pi 3B. This is built using the 32 bit OS because when I attempted to build using 64 bit that failed. Everything runs great. I’d like to add the device to our Tailscale network so I can remotely update the Anthias configuration. The build however is failing. Any assistance in resolving this would be great. If the answer is to use a different build, that’d be OK too.

Ref: [GitHub - hslatman/tailscale-balena-rpi: Raspberry Pi 3 powered by Balena serving Tailscale mesh VPN node](https://github.com/hslatman/tailscale-balena-rpi/tree/main)

$ balena build --fleet myfleet  
[Build] Building services…  
[Build] tailscale Preparing…  
[Info] Building for armv7hf/raspberrypi3  
[Build] tailscale Step 1/21 : ARG BALENA\_MACHINE\_NAME\_ARG=raspberrypi3  
[Build] tailscale Step 2/21 : FROM balenalib/$BALENA\_MACHINE\_NAME\_ARG-debian-golang:build as builder  
[Build] tailscale —\> cfbbb661ff22  
[Build] tailscale Step 3/21 : ENV BALENA\_MACHINE\_NAME raspberrypi3  
[Build] tailscale —\> [Warning] The requested image’s platform (linux/arm/v7) does not match the detected host platform (linux/amd64/v4) and no specific platform was requested  
[Build] tailscale —\> Running in 9b5993537f3e  
[Build] tailscale —\> Removed intermediate container 9b5993537f3e  
[Build] tailscale —\> 943b6c967c1d  
[Build] tailscale Step 4/21 : ENV BALENA\_OS\_VERSION 6.5.50+rev2.prod  
[Build] tailscale —\> [Warning] The requested image’s platform (linux/arm/v7) does not match the detected host platform (linux/amd64/v4) and no specific platform was requested  
[Build] tailscale —\> Running in 107760ea97b8  
[Build] tailscale —\> Removed intermediate container 107760ea97b8  
[Build] tailscale —\> 62406f24c32e  
[Build] tailscale Step 5/21 : RUN install\_packages curl build-essential libelf-dev libssl-dev pkg-config git flex bison bc python kmod  
[Build] tailscale —\> [Warning] The requested image’s platform (linux/arm/v7) does not match the detected host platform (linux/amd64/v4) and no specific platform was requested  
[Build] tailscale —\> Running in 788e6c6a7246  
[Build] tailscale exec /bin/sh: exec format error  
[Build] Built 1 service in 0:01  
[Error] Build failed.  
The command ‘/bin/sh -c install\_packages curl build-essential libelf-dev libssl-dev pkg-config git flex bison bc python kmod’ returned a non-zero code: 255

---

<div class="post-metadata">

**Author:** ![alanb128](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alanb128/32/2839_2.png) [@alanb128](https://forums.balena.io/u/alanb128)\
**Post date:** [October 10, 2025, 4:33am UTC](https://forums.balena.io/t/trouble-building-tailscale-for-pi-3b/374909/2 "2025-10-10T04:33:18Z")

</div>

Hello, I tried building that project and did not get that error. The only env line I changed was `ENV BALENA_OS_VERSION 6.5.50+rev2` without the `.prod`

You’ll also need to change the line:

```auto
RUN curl -L -o headers.tar.gz $(echo "https://files.balena-cloud.com/images/$BALENA_MACHINE_NAME/$BALENA_OS_VERSION/kernel_modules_headers.tar.gz" | sed -e 's/+/%2B/') && \  
    tar -xf headers.tar.gz

```

to:

```auto
RUN curl -L -o headers.tar.gz $(echo "https://files.balena-cloud.com/images/$BALENA_MACHINE_NAME/$BALENA_OS_VERSION/kernel-source.tar.gz" | sed -e 's/+/%2B/') && \  
    tar -xf headers.tar.gz

```

Since this example is a bit older and also uses the deprecated balenalib base image, have you considered using Tailscale’s official Docker image?

Also note that you could use balena’s public URL feature to access the Anthias config page instead of Tailscale: [Actions and Settings | balena](https://docs.balena.io/learn/manage/actions/#public-device-url)

(The Public Device URL feature is a tool for remote configuration, debugging, and other intermittent or periodic use cases.)

---

<div class="post-metadata">

**Author:** ![novice603](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/novice603/32/10515_2.png) [@novice603](https://forums.balena.io/u/novice603)\
**Post date:** [October 14, 2025, 1:08pm UTC](https://forums.balena.io/t/trouble-building-tailscale-for-pi-3b/374909/3 "2025-10-14T13:08:18Z")

</div>

Using the Tailscale official image would be OK, I’m not sure how to use it. On my other devices, I ssh into them and run docker commands to retrieve the images, build them, and get them running. With Balena, I don’t know how to setup a build environment from scratch. All I’ve done to date is copy a git installation that has everything setup and then use _balena build_ to create the installation.

---

<div class="post-metadata">

**Author:** ![novice603](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/novice603/32/10515_2.png) [@novice603](https://forums.balena.io/u/novice603)\
**Post date:** [October 14, 2025, 3:24pm UTC](https://forums.balena.io/t/trouble-building-tailscale-for-pi-3b/374909/4 "2025-10-14T15:24:09Z")

</div>

It looks like I’m getting closer. I was able to build tailscale and install it.

My Dockerfile.template:

```auto
FROM tailscale/tailscale:latest

# You can add any specific dependencies or configurations needed for your Balena setup here.
# For example, if you need specific tools for debugging or other services.
# RUN apt-get update && apt-get install -y --no-install-recommends some-tool && rm -rf /var/lib/apt/lists/*

# Set the entrypoint to run tailscaled
ENTRYPOINT ["tailscaled"]

```

My docker-compose.yml

```auto
version: "2.1"

volumes:
  tailscale-state: {}

services:
  tailscale:
    # privileged may be optional, but requires manual step in that case
    # https://github.com/tailscale/tailscale/issues/504
    privileged: true
    environment:
      - TS_AUTHKEY="myauthkey"
    build:
      context: ./tailscale-official
      dockerfile: Dockerfile.template
    cap_add:
      - NET_ADMIN
      - NET_RAW
    network_mode: host
    volumes:
      - tailscale-state:/tailscale
    devices:
      - /dev/net/tun:/dev/net/tun
    labels:
      io.balena.features.kernel-modules: '1'
      io.balena.features.sysfs: '1'

```

According to the Balena dashboard, tailscale is running. My current problem is that Tailscale doesn’t seem to have tried to authenticate as I can’t see it in my Tailscale machine list waiting for authentication.

---

<div class="post-metadata">

**Author:** ![novice603](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/novice603/32/10515_2.png) [@novice603](https://forums.balena.io/u/novice603)\
**Post date:** [October 14, 2025, 3:58pm UTC](https://forums.balena.io/t/trouble-building-tailscale-for-pi-3b/374909/5 "2025-10-14T15:58:52Z")

</div>

And it works! I used the Balena dashboard to connect a Tailscale terminal session. Once connected, I ran “tailscale up” and completed the authentication steps. I can ping the device. Looks like I need to make port 80 on the PI available via the docker container. Off to figure that out.
