DockerfileBuildOptions Class
Options for building an image from a Dockerfile. Pass them to ImageSource.FromDockerfile, which copies them: later changes do not affect the image source.
public sealed class DockerfileBuildOptionsConstructors
| Name | Description |
|---|---|
| DockerfileBuildOptions() |
DockerfileBuildOptions()
DockerfileBuildOptions.cspublic DockerfileBuildOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| BuildArguments | Gets the build-time variables, the values of the ARG instructions of the Dockerfile (--build-arg). |
| Labels | Gets the labels added to the built image. |
| NoCache | Gets or sets a value indicating whether the build ignores the build cache (--no-cache). |
| Platform | Gets or sets the platform to build the image for, such as linux/amd64 (--platform). When null, ContainerDefinition.Platform is used. |
| Pull | Gets or sets a value indicating whether the build pulls a newer version of the base images, even when they are on the machine (--pull). |
| Tag | Gets or sets the name the image is tagged with, such as my-app:test. When null, the image gets a random name and is removed with the container. |
| Target | Gets or sets the stage of a multi-stage Dockerfile to build (--target). When null, the last stage is built. |
BuildArguments
DockerfileBuildOptions.csGets the build-time variables, the values of the ARG instructions of the Dockerfile (--build-arg).
public IDictionary<string, string> BuildArguments { get; }Property value
Gets the labels added to the built image.
public IDictionary<string, string> Labels { get; }Property value
NoCache
DockerfileBuildOptions.csPlatform
DockerfileBuildOptions.csGets or sets the platform to build the image for, such as linux/amd64 (--platform). When null, ContainerDefinition.Platform is used.
public string? Platform { get; set; }Property value
Gets or sets the name the image is tagged with, such as my-app:test. When null, the image gets a random name and is removed with the container.
public string? Tag { get; set; }Property value
Remarks
An image with a tag of your choosing belongs to you: it is neither removed with the container nor by ContainerRuntime.CleanupAsync. Every build replaces it, and the build cache of the runtime makes a build of unchanged sources fast without leaving a new image behind.