Share via


DockerfileBuilder Class

Definition

Builder for creating Dockerfiles programmatically.

public class DockerfileBuilder
type DockerfileBuilder = class
Public Class DockerfileBuilder
Inheritance
DockerfileBuilder

Constructors

DockerfileBuilder()

Initializes a new instance of the DockerfileBuilder class.

Properties

Stages

Gets the stages in this Dockerfile.

Methods

Arg(String, String)

Adds a global ARG statement to define a build-time variable with a default value before any stages.

Arg(String)

Adds a global ARG statement to define a build-time variable before any stages.

From(String, String)

Adds a FROM statement to start a new named stage.

From(String)

Adds a FROM statement to start a new stage.

WriteAsync(StreamWriter, CancellationToken)

Writes the Dockerfile content to the specified StreamWriter.

Extension Methods

AddContainerFilesStages(DockerfileBuilder, IResource, ILogger)

Adds Dockerfile instructions to include container files from the specified resource into the Dockerfile build process.

Applies to