Currently, when we initialize a new dispatchState, buildArgs are not carried forward from the base.
This causes a subtle issue while linting where a Dockerfile such as
FROM alpine AS declared
ARG foo
COPY $foo .
FROM declared AS dependent
COPY $foo .
Will erroneously emit a UndeclaredVariable linting warning for the occurrence of $foo in the dependent stage.
This updates dispatchState to initialize buildArgs from its base.
Currently, when we initialize a new
dispatchState
,buildArgs
are not carried forward from thebase
. This causes a subtle issue while linting where a Dockerfile such asWill erroneously emit a
UndeclaredVariable
linting warning for the occurrence of$foo
in thedependent
stage.This updates
dispatchState
to initializebuildArgs
from its base.