https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
The following ARG variables are set automatically:
TARGETPLATFORM
- platform of the build result. Eg linux/amd64, linux/arm/v7, windows/amd64.TARGETOS
- OS component of TARGETPLATFORM, Eg linux, windows, wasiTARGETARCH
- architecture component of TARGETPLATFORM, Eg amd64, arm64, wasm32TARGETVARIANT
- variant component of TARGETPLATFORMBUILDPLATFORM
- platform of the node performing the build.BUILDOS
- OS component of BUILDPLATFORMBUILDARCH
- architecture component of BUILDPLATFORMBUILDVARIANT
- variant component of BUILDPLATFORM
docker buildx build --platform linux/amd64,linux/arm64 -t zengxu/example --push -f Dockerfile.dev .