Package dockerfile is the evaluation step in the Dockerfile parse/evaluate pipeline.
It incorporates a dispatch table based on the parser.Node values (see the parser package for more information) that are yielded from the parser itself. Calling NewBuilder with the BuildOpts struct can be used to customize the experience for execution purposes only. Parsing is controlled in the parser package, and this division of responsibility should be respected.
Please see the jump table targets for the actual invocations, most of which will call out to the functions in internals.go to deal with their tasks.
ONBUILD is a special case, which is covered in the onbuild() func in dispatchers.go.
The evaluator uses the concept of "steps", which are usually each processable line in the Dockerfile. Each step is numbered and certain actions are taken before and after each step, such as creating an image ID and removing temporary containers and images. Note that ONBUILD creates a kinda-sorta "sub run" which includes its own set of steps (usually only one of them).