On an Apple Silicon Mac or a Raspberry Pi, an image that was only built for x86 fails with a message that no matching manifest was found for your platform. The platform attribute asks for the other architecture explicitly.
services:
legacy:
image: example/legacy-tool:2.1
platform: linux/amd64
On the command line it is docker run --platform linux/amd64. Docker pulls the amd64 variant and runs it through emulation. Docker Desktop has that emulation built in; on a Linux host it needs QEMU binfmt handlers installed first.
To find out which architectures an image offers before you try, ask the registry:
docker buildx imagetools inspect example/legacy-tool:2.1
I see this as a stopgap. Emulated containers run noticeably slower, use more CPU, and the odd program crashes under emulation in ways it never would on real hardware. If an arm64 build exists, even under a different tag, I would pick that one. It also works the other way round: pinning linux/amd64 in a shared file makes every ARM user run emulated, so keep the line in a local override instead of the main file.
Further reading: Compose file reference: platform, Multi-platform builds