ryansch / docker-unifi-rpi

Unifi Controller for Raspberry Pi 3+ and x86
https://hub.docker.com/r/ryansch/unifi-rpi/
347 stars 42 forks source link

Warning of image platform and detected host platform mismatch after installing on Ubuntu Server 22.04 64 bit #106

Open Drel opened 9 months ago

Drel commented 9 months ago

After installing following the Wiki directions on a freshly installed and updated 64 bit version of Ubuntu Server 22.04 on a Raspberry Pi 4, I noticed the following output from docker after starting the unifi service with systemctl. I used the exact compose.yml as given in the Wiki.

Dec 07 18:53:47 unifi docker[1059]: Going to remove unifi Dec 07 18:53:47 unifi docker[1059]: Container unifi Removing Dec 07 18:53:47 unifi docker[1059]: Container unifi Removed Dec 07 18:53:47 unifi systemd[1]: Started Unifi Controller. Dec 07 18:53:47 unifi docker[1083]: Container unifi Creating Dec 07 18:53:48 unifi docker[1083]: unifi The requested image's platform (linux/arm64v8) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested Dec 07 18:53:48 unifi docker[1083]: Container unifi Created Dec 07 18:53:48 unifi docker[1083]: Attaching to unifi Dec 07 18:53:49 unifi docker[1083]: unifi | init complete... Dec 07 18:53:49 unifi docker[1083]: unifi | Loading /usr/lib/unifi/data/system_env

The requested image platform is linux/arm64v8 whereas the detected host platform is linux/arm64/v8 (note extra slash). What would be the appropriate way to resolve the warning? Specify a specific platform (linux/arm64/v8) within the compose.yml file?

ryansch commented 8 months ago

This is a class of failure I've tried to understand over the years. I have no idea what causes docker to request non-standard image archs.

ryansch commented 2 months ago

I'm getting this error now!

ryansch commented 2 months ago

It seems like a classic vs buildkit issue.

poberg commented 2 months ago

The normalized platform names can be find in containerd source code

// The following are performed for architectures:
//
//   Value    Normalized
//   aarch64  arm64
//   armhf    arm
//   armel    arm/v6
//   i386     386
//   x86_64   amd64
//   x86-64   amd64

In build.sh the platform shoud be arm64, not arm64v8. Possibly arm64/v8 would also work.