Skip to content

Instantly share code, notes, and snippets.

@chabala
Created April 22, 2023 22:31
Show Gist options
  • Save chabala/7b72770cd6b7089bf87546c3771b7c8b to your computer and use it in GitHub Desktop.
Save chabala/7b72770cd6b7089bf87546c3771b7c8b to your computer and use it in GitHub Desktop.
Check Docker detected system architecture

Check system arch:

$ arch
armv7l

Check docker info:

$ docker info 2>/dev/null |grep 'OSType:\|Arch'
 OSType: linux
 Architecture: armv7l

Pull a small amd64-only image and check the error:

$ docker run --rm -it cogniteev/echo
Unable to find image 'cogniteev/echo:latest' locally
latest: Pulling from cogniteev/echo
Image docker.io/cogniteev/echo:latest uses outdated schema1 manifest format. Please upgrade to a schema2 image for better future compatibility. More information at https://docs.docker.com/registry/spec/deprecated-schema-v1/
a3ed95caeb02: Pull complete 
a50c7ac0beb8: Pull complete 
Digest: sha256:1373862ff5e33b19edc9f38ddb6522e790719c3049c764f515921fd4069e8131
Status: Downloaded newer image for cogniteev/echo:latest
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
exec /bin/echo: exec format error

This shows you the detected host platform, in this case linux/arm/v7, or quickly exits if you're on linux/amd64.

The real question, why is the docker platform tagged linux/arm/v7 and not linux/armv7l? Wouldn't that have been more consistent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment