-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FROM ${TARGETARCH} wrongly detected as "base name should not be blank" #4012
Comments
@rcjsuen can you take a look? |
@timon-schelling Interesting. I guess you are using the |
@rcjsuen, No ${TARGETPLATFORM} is provided by docker. See https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope Docker predefines a set of ARG variables with information on the platform of the node performing the build (build platform) and on the platform of the resulting image (target platform). The target platform can be specified with the --platform flag on docker build. The following ARG variables are set automatically:
|
@timon-schelling Right. But to clarify, you can't just use that variable to build, right? FROM ${TARGETARCH} as build
|
Looks like a buildx thing. I don't know how to go forward than. When using buildx the hint is wrong but otherwise... |
Yes one needs to define platform stages first. I define stages for all platforms I need like this:
|
Since the architecture cannot be deduced with certainty I think I may have to just loosen the rules to allow "undefined" variables to be set to a |
Opened rcjsuen/dockerfile-utils#119 to track this. Thanks for reporting this, @timon-schelling. |
Dockers build in automatic platform args in the global scope should be recognized and should not be annotated as missing.
https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
Example:
The text was updated successfully, but these errors were encountered: