Skip to content
Docs Try Aspire

Build Properties

Class Properties 6 members
Represents the build configuration for a service within a Docker Compose file. This class is used to define various build parameters such as context, dockerfile, arguments, target stages, cache sources, and labels.
Args Section titled Args Dictionary<string, string>
Gets or sets a dictionary of build arguments for the Docker image. Build arguments provide values that can be passed to the Dockerfile during the build process. These arguments allow customization of the build process by defining key-value pairs that are accessible within the Dockerfile.
public Dictionary<string, string> Args { get; set; }
CacheFrom Section titled CacheFrom List<string>
Gets or sets a list of cache sources to be used during the build process. This property corresponds to the "cache_from" field in a Docker Compose build configuration and allows specifying external images or sources to use as a cache for layers during Docker image builds.
public List<string> CacheFrom { get; set; }
Context Section titled Context nullable string?
Gets or sets the build context for the service in the Docker Compose file. The context specifies the directory containing the Dockerfile and other resources needed for building the image.
public string? Context { get; set; }
Dockerfile Section titled Dockerfile nullable string?
Specifies the path to the Dockerfile used for building the Docker image. This property points to the Dockerfile that contains the instructions for building the service image in a Docker Compose configuration.
public string? Dockerfile { get; set; }
Labels Section titled Labels Dictionary<string, string>
Gets or sets the collection of additional labels to be applied to the build. Labels are key-value pairs that provide metadata about the build.
public Dictionary<string, string> Labels { get; set; }
Target Section titled Target nullable string?
Specifies the target build stage to be used from a multi-stage Dockerfile. This property allows defining a specific target stage name, enabling partial builds and optimizing the build process by selecting only the required build stage.
public string? Target { get; set; }