# API Reference


## Entry points


Declare config and render a recipe into a Dockerfile.


[Dockerfile](entry-points.md#docker_dsl.Dockerfile)  
Renders a recipe module into Dockerfile text.

[BuildContext](entry-points.md#docker_dsl.BuildContext)  
Recipe-facing handle for config fields, exported as `context`.

[rendering()](entry-points.md#docker_dsl.rendering)  
Report whether a render pass is in progress.


## Stage authoring


Declare stages and emit instructions.


[Stage](stage-authoring.md#docker_dsl.Stage)  
A build stage -- one `FROM` and the instructions that follow it.

[MountScope](stage-authoring.md#docker_dsl.MountScope)  
A `with` block that applies a mount to the `RUN` commands inside it.

[EnvScope](stage-authoring.md#docker_dsl.EnvScope)  
A `with` block that confines env variables to the `RUN` commands inside.


## The run builder


Accumulate shell commands into one RUN instruction.


[RunBuilder](the-run-builder.md#docker_dsl.RunBuilder)  
Accumulates shell commands into a single `RUN` instruction.

[AptMixin](the-run-builder.md#docker_dsl.AptMixin)  
AptMixin(\*, apt_updated: 'bool' = False, apt_dirty: 'bool' = True)

[RedirectableCmd](the-run-builder.md#docker_dsl.RedirectableCmd)  
A pending `echo` awaiting a redirect target.

[CdScope](the-run-builder.md#docker_dsl.CdScope)  
A `cd` that optionally restores the previous directory.

[CmdInvoker](the-run-builder.md#docker_dsl.CmdInvoker)  
A bound shell binary, produced by `RunBuilder`'s attribute dispatch.


## Introspection


Query the active build during a render pass.


[current_stage()](introspection.md#docker_dsl.current_stage)  
Return the stage of the innermost open `with Stage(...)` block.
