Skip to content

Commit b2d2ba6

Browse files
committed
Fix container image detection for aarch64
It seems that on newer Docker (e.g. 28.0.4) the container image built on the local system on an 64-bit Arm systems returns the architecture variant just like on 32-bit Arm (but v8 in this case). This is not expected by the current code. To make Supervisor detect the image correctly on new and old Docker versions, use substring matching.
1 parent 406348c commit b2d2ba6

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

supervisor/docker/interface.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,16 @@ async def check_image(
478478
image_arch = f"{image_arch}/{image.attrs['Variant']}"
479479

480480
# If we have an image and its the right arch, all set
481-
if MAP_ARCH[expected_image_arch] == image_arch:
481+
# It seems that newer Docker version return a variant for arm64 images.
482+
# Make sure we match linux/arm64 and linux/arm64/v8.
483+
if image_arch.startswith(MAP_ARCH[expected_image_arch]):
482484
return
485+
_LOGGER.info(
486+
"Image %s has arch %s, expected %s. Reinstalling.",
487+
image_name,
488+
image_arch,
489+
expected_image_arch,
490+
)
483491

484492
# We're missing the image we need. Stop and clean up what we have then pull the right one
485493
with suppress(DockerError):

0 commit comments

Comments
 (0)