Use case
Modern Dockerfile and BuildKit specifications (Dockerfile v1.8+) support the --description flag on ARG instructions:
ARG --description="Target binary release version" VERSION=1.0.0
Earthfile currently supports --required and --global options on ARG (earthfile.abnf:L308), but lacks explicit --description="..." support.
Adding ARG --description="..." to Earthfile will allow recipe authors to document build arguments directly in code, improving developer experience and integrating seamlessly with EarthBuild's CLI documentation tool (earth doc), which inspects target argument descriptions.
Expected Behavior
Usage in Earthfiles
build:
ARG --description="Environment stage (dev, staging, prod)" ENV=prod
ARG --required --description="Database connection URL" DB_URL
FROM alpine:3.18
RUN echo "Building for ${ENV}"
CLI Documentation Integration (earth doc)
earth doc +build automatically renders argument descriptions provided via --description="...".
Grammar Specification (earthfile.abnf)
Update arg-option in internal/earthfile/earthfile.abnf:
arg-option = "--required" / "--global" / ( "--description" "=" ( WORD / QUOTED-STRING ) )
Use case
Modern Dockerfile and BuildKit specifications (Dockerfile v1.8+) support the
--descriptionflag onARGinstructions:Earthfile currently supports
--requiredand--globaloptions onARG(earthfile.abnf:L308), but lacks explicit--description="..."support.Adding
ARG --description="..."to Earthfile will allow recipe authors to document build arguments directly in code, improving developer experience and integrating seamlessly with EarthBuild's CLI documentation tool (earth doc), which inspects target argument descriptions.Expected Behavior
Usage in Earthfiles
CLI Documentation Integration (
earth doc)earth doc +buildautomatically renders argument descriptions provided via--description="...".Grammar Specification (
earthfile.abnf)Update
arg-optionininternal/earthfile/earthfile.abnf: