共用方式為


ContainerResourceBuilderExtensions Class

Definition

Provides extension methods for IDistributedApplicationBuilder to add container resources to the application.

public static class ContainerResourceBuilderExtensions
type ContainerResourceBuilderExtensions = class
Public Module ContainerResourceBuilderExtensions
Inheritance
ContainerResourceBuilderExtensions

Methods

AddContainer(IDistributedApplicationBuilder, String, String, String)

Adds a container resource to the application.

AddContainer(IDistributedApplicationBuilder, String, String)

Adds a container resource to the application. Uses the "latest" tag.

AddDockerfile(IDistributedApplicationBuilder, String, String, String, String)

Adds a Dockerfile to the application model that can be treated like a container resource.

PublishAsContainer<T>(IResourceBuilder<T>)

Changes the resource to be published as a container in the manifest.

WithBindMount<T>(IResourceBuilder<T>, String, String, Boolean)

Adds a bind mount to a container resource.

WithBuildArg<T>(IResourceBuilder<T>, String, IResourceBuilder<ParameterResource>)

Adds a build argument when the container is built from a Dockerfile.

WithBuildArg<T>(IResourceBuilder<T>, String, Object)

Adds a build argument when the container is build from a Dockerfile.

WithBuildSecret<T>(IResourceBuilder<T>, String, IResourceBuilder<ParameterResource>)

Adds a secret build argument when the container is built from a Dockerfile.

WithContainerName<T>(IResourceBuilder<T>, String)

Overrides the default container name for this resource. By default Aspire generates a unique container name based on the resource name and a random postfix (or a postfix based on a hash of the AppHost project path for persistent container resources). This method allows you to override that behavior with a custom name, but could lead to naming conflicts if the specified name is not unique.

WithContainerRuntimeArgs<T>(IResourceBuilder<T>, Action<ContainerRuntimeArgsCallbackContext>)

Adds a callback to be executed with a list of arguments to add to the container runtime run command when a container resource is started.

WithContainerRuntimeArgs<T>(IResourceBuilder<T>, Func<ContainerRuntimeArgsCallbackContext,Task>)

Adds a callback to be executed with a list of arguments to add to the container runtime run command when a container resource is started.

WithContainerRuntimeArgs<T>(IResourceBuilder<T>, String[])

Adds a callback to be executed with a list of arguments to add to the container runtime run command when a container resource is started.

WithDockerfile<T>(IResourceBuilder<T>, String, String, String)

Causes .NET Aspire to build the specified container image from a Dockerfile.

WithEntrypoint<T>(IResourceBuilder<T>, String)

Sets the Entrypoint for the container.

WithImage<T>(IResourceBuilder<T>, String, String)

Allows overriding the image on a container.

WithImageRegistry<T>(IResourceBuilder<T>, String)

Allows overriding the image registry on a container.

WithImageSHA256<T>(IResourceBuilder<T>, String)

Allows setting the image to a specific sha256 on a container.

WithImageTag<T>(IResourceBuilder<T>, String)

Allows overriding the image tag on a container.

WithLifetime<T>(IResourceBuilder<T>, ContainerLifetime)

Sets the lifetime behavior of the container resource.

WithVolume<T>(IResourceBuilder<T>, String, String, Boolean)

Adds a volume to a container resource.

WithVolume<T>(IResourceBuilder<T>, String)

Adds an anonymous volume to a container resource.

Applies to