Skip to content
DocsTry Aspire
DocsTry

DockerfileBuildAnnotation Properties

ClassProperties10 members
Represents an annotation for customizing a Dockerfile build.
BuildArgumentsSection titled BuildArgumentsDictionary<string, object?>
Gets the arguments to pass to the build.
public Dictionary<string, object?> BuildArguments { get; }
BuildContextIgnoreContentSection titled BuildContextIgnoreContentnullablestring?
Gets or sets the default .dockerignore content to emit alongside the published Dockerfile using BuildKit's per-Dockerfile ignore convention ( <dockerfile-name>.dockerignore next to the Dockerfile).
public string? BuildContextIgnoreContent { get; set; }
When the build context root already contains a .dockerignore authored by the user, generated per-Dockerfile files are removed so the user's file is honored. User-authored per-Dockerfile ignore files are preserved because BuildKit gives them precedence over the context-root file. See https://docs.docker.com/build/concepts/context/#filename-and-location.
BuildSecretsSection titled BuildSecretsDictionary<string, object>
Gets the secrets to pass to the build.
public Dictionary<string, object> BuildSecrets { get; }
Gets the path to the context directory for the build.
public string ContextPath { get; }
DockerfileFactorySection titled DockerfileFactorynullableFunc<DockerfileFactoryContext, Task<string>>
Gets or sets the factory function that generates Dockerfile content dynamically. When set, this factory will be invoked to generate the Dockerfile content at build time, and the content will be written to a generated file path.
public Func<DockerfileFactoryContext, Task<string>>? DockerfileFactory { get; init; }
DockerfilePathSection titled DockerfilePathstring
Gets the path to the Dockerfile to use for the build.
public string DockerfilePath { get; }
Gets or sets a value indicating whether an entry point is defined in the Dockerfile.
public bool HasEntrypoint { get; set; }
Container images without an entry point are not considered compute resources.
ImageNameSection titled ImageNamenullablestring?
Gets or sets the image name for the generated container image. When set, this will be used as the container image name instead of the value from ContainerImageAnnotation.
public string? ImageName { get; set; }
ImageTagSection titled ImageTagnullablestring?
Gets or sets the image tag for the generated container image. When set, this will be used as the container image tag instead of the value from ContainerImageAnnotation.
public string? ImageTag { get; set; }
StageSection titled Stagenullablestring?
Gets the name of the build stage to use for the build.
public string? Stage { get; }