Previously, when I was only interested in x86 (i.e., the default on my machine), I would use a tag like ubuntu:18.04, but now I need to incorporate the platform.
I know this must be simple, but it’s not obvious from any documentation I have seen.
I just figured it out, but for completeness here is a hopefully better explanation:
Previously I would pull an ubuntu 18.04 image using the CLI with:
docker pull ubuntu:18.04
But at that time I was on an Intel processor (x86-64) Mac. It did the right thing and pulled an x86-64 image for me.
Since then, I moved to an Apple-Silicon processor (Armv8.3 aarch64) . When I tried the same command, it pulled an x86-64 version. This worked but not natively and there is a performance penalty. In other words, docker did not pull the appropriate architecture.
I have discovered I can use the following to get the correct host platform architecture:
docker pull arm64v8/ubuntu:18.04
More generically, it means the image is named with ${HOST_ARCH}/${OS_NAME}:${OS_VERSION}, which is what I was searching for.
This information is additionally useful as I am moving towards creating multiple architecture containers.