eclipse-kanto / container-management

container-management
Other
6 stars 10 forks source link

Error while trying to create container on raspberry pi #161

Closed antonia-avramova closed 1 year ago

antonia-avramova commented 1 year ago

uname -a Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

When I try to create container

sudo kanto-cm create docker.io/library/hello-world:latest or sudo kanto-cm create docker.io/library/redis:6.2

The result is the error: Error: rpc error: code = Unknown desc = you are not authorized to use this image: No manifest found for local platform

k-gostev commented 1 year ago

This usually happens when there is an issue with the rasbpbian installation on a 32 based architecture. The name - a may report aarch64 when it should be aemv7l. This may causes issues with some libraries as well as containerd. Reinstalling the raspberry with the proper image should solve this issue.

dimitar-dimitrow commented 1 year ago

This happened because a 32bit RPi OS is installed on raspberry Pi with CPU with 64bit architecture. The default platform is reported as GOARCH - arm and /proc/cpuinfo returns a 64-bit ARMv8 processor.

The reported error comes from the imgcrypt library as it makes a strict platform match for arm v8, when a container with a multi-arch image is created. On the other side conteinerd has a mechanism to fallback through the cpu variants - https://github.com/containerd/containerd/pull/4932. So in the case of docker.io/library/hello-world:latest image the arm v7 image gets downloaded in first place. As a result imgcrypt's encrypt.CheckAuthorization returns error due to its strict match - e.g. arm v8 does not march arm v7.

A workaround would be added, the platform match would be performed in the kanto container management.