I have a Dockerfile
that starts with:
FROM pihole/pihole:v5.8.1
When I issue balena push <id>.local
to build the containers in my compose script, I get an error:
Some services failed to build:
pihole1: failed to get destination image "sha256:7c5d96503a8e2a5398356b024415fd6caf18ea08b3ce07b81034f14ce87196fa": image with reference sha256:7c5d96503a8e2a5398356b024415fd6caf18ea08b3ce07b81034f14ce87196fa was found but does not match the specified platform: wanted linux/arm64/v8, actual: linux/amd64
But the image it’s looking for is right here.
What’s up with that?
I tried explicitly telling it the platform:
FROM --platform=linux/arm64/v8 pihole/pihole:v5.8.1
But Balena complains that that’s a syntax error (why? Nothing I’ve found in the Docker documentation, Balena documentation or Google indicates this should be a syntax error. )
Okay… so I tried specifying platform in the compose script… again, Balena whines that there’s a problem with the compose script. Fine, whatever, it clearly knew the correct platform anyway. I’m just annoyed that specifying the platform doesn’t work even though as best I can tell it should.
Anyway, moving on.
So I SSH into my RaspberryPi4 that I was trying to push to, and I run:
root@<id>:~# balena pull --platform linux/arm64/v8 pihole/pihole:v5.8.1
v5.8.1: Pulling from pihole/pihole
62adb93deb28: Pull complete
e848e22cf95b: Pull complete
e66b05c8f94b: Pull complete
bfcae7e0347e: Pull complete
35abc933bb43: Pull complete
62e5796f84c2: Pull complete
8b560abe847e: Pull complete
58db3e14c2d4: Pull complete
Total: [==================================================>] 184.1MB/184.1MB
Digest: sha256:b51628bfa49b71ce4af4831b34e276693a6d647b82037151d8eb0d34da504432
Status: Downloaded newer image for pihole/pihole:v5.8.1
docker.io/pihole/pihole:v5.8.1
root@<id>:~#
Okay, so apparently is is able to find the correct image… except… wait… the sha256 is wrong.
hub.docker.com: sha256:1c02cda06ba1b997d10e0c12743002e845ed87bf010fca0ad838c3dba6ac6c58
As best I can tell, there are no pihole images with a sha256 matching the one that was pulled.
What the heck is going on here? Is it not using the Docker image repository? Is it secretly modifying the images it downloads behind the scenes? Why is it failing to find it for the correct architecture when I try to build the container?
(The build takes place on the device)