You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specifying --platform= with a constant value in the Dockerfile FROM instruction forces the Image to build only one target platform. This has some drawbacks:
Make it no longer possible to build a multi-platform Image from this Dockerfile.
The platform that you build on must be the same as the platform specified in --platform=
The recommended approach include:
Omit FROM --platform in the docker file and to specify in buildx --platform= during the build if control of the image platform target is needed.
Use the $BUILDPLATFORM or other combination of variables for --platform in a FROM
stage name should include a valid OS or ARCH
--platform flag should not be used with a constant value, unless stage name also contains os or arch
Reference
BUILDPLATFORM — matches the current machine. (e.g. linux/amd64)
BUILDOS — os component of BUILDPLATFORM, e.g. linux
BUILDARCH — e.g. amd64, arm64, riscv64
The text was updated successfully, but these errors were encountered:
tonistiigi
changed the title
Add check for usage of --platfomr= flag in Dockerfile FROM (FromPlatformFlagConstDisallowed)
Add check for usage of --platform= flag in Dockerfile FROM (FromPlatformFlagConstDisallowed)
Jul 8, 2024
Specifying --platform= with a constant value in the Dockerfile
FROM
instruction forces the Image to build only one target platform. This has some drawbacks:--platform=
The recommended approach include:
FROM --platform
in the docker file and to specify in buildx--platform=
during the build if control of the image platform target is needed.$BUILDPLATFORM
or other combination of variables for--platform
in aFROM
stage name should include a valid OS or ARCH
--platform
flag should not be used with a constant value, unless stage name also contains os or archReference
BUILDPLATFORM
— matches the current machine. (e.g. linux/amd64)BUILDOS
— os component of BUILDPLATFORM, e.g. linuxBUILDARCH
— e.g. amd64, arm64, riscv64The text was updated successfully, but these errors were encountered: