You must support both amd64 and arm64 users (Apple Silicon laptops, Graviton in prod).
IntermediateScenarioImage design and Dockerfile decisions
Answer
Situation read → Need a multi-arch manifest list.
What I'd do →
docker buildx create --use --name multi
docker buildx build --platform linux/amd64,linux/arm64 \
-t registry.example.com/app:1.4.0 --push .
In the Dockerfile use ARG TARGETARCH for arch-specific downloads and cross-compile in the build stage with FROM --platform=$BUILDPLATFORM to avoid slow QEMU emulation.
Why → One tag resolves to the right image per node.
Interview tip → Verify with docker buildx imagetools inspect app:1.4.0.
More on Image design and Dockerfile decisions
A teammate's Node.js image is 1.2 GB. How do you approach shrinking it?BeginnerYou need to run `apt-get install` in a Dockerfile. How do you write it so the layer stays small and cache-safe?BeginnerWhen would you pick `COPY` over `ADD`?BeginnerA service must run a startup script and then the app. Should you use `CMD`, `ENTRYPOINT`, or both?BeginnerYour Docker build re-installs all Python dependencies on every code change. Fix it.BeginnerProduct asks for a container that runs both nginx and a Python app. What do you say?Beginner