mirror of
https://github.com/moby/buildkit.git
synced 2026-10-28 16:44:37 +08:00
--opt build-arg:FOO failed the whole build with "invalid value build-arg:FOO" instead of taking FOO from the client environment, so callers had to spell out --opt build-arg:FOO=$FOO. "docker buildx build --build-arg FOO" reads the environment, and buildctl already propagates SOURCE_DATE_EPOCH from the environment into a build arg in loadOptEnv, so the valueless form was the odd one out. Resolve it in ParseOpt rather than in attrMap: attrMap is shared with --local, where a value is still required. A variable that is not present in the environment is left out of the frontend attributes entirely rather than sent as an empty string, so a default in the Dockerfile still applies. Signed-off-by: Ravi Arnan <raviarnankeren@gmail.com>