ContainerResource
Handle
interface ContainerResource extends IComputeResource, IResource, IResourceWithArgs, IResourceWithEndpoints, IResourceWithEnvironment, IResourceWithProbes, IResourceWithWaitSupport { publishAsConnectionString(): ContainerResource; publishAsContainer(): ContainerResource; withBindMount( source: string, target: string, isReadOnly?: boolean): ContainerResource; withBuildArg( name: string, value: ParameterResource): ContainerResource; withBuildSecret( name: string, value: ParameterResource): ContainerResource; withContainerCertificatePaths( customCertificatesDestination?: string, defaultCertificateBundlePaths?: string[], defaultCertificateDirectoryPaths?: string[]): ContainerResource; withContainerName(name: string): ContainerResource; withContainerNetworkAlias(alias: string): ContainerResource; withContainerRuntimeArgs(args: string[]): ContainerResource; withDockerfile( contextPath: string, dockerfilePath?: string, stage?: string): ContainerResource; withDockerfileBuilder(contextPath: string, callback: (arg: DockerfileBuilderCallbackContext) => Promise<void>, stage?: string): ContainerResource; withDockerfileFactory(contextPath: string, dockerfileFactory: (arg: DockerfileFactoryContext) => Promise<string>, stage?: string): ContainerResource; withEntrypoint(entrypoint: string): ContainerResource; withImage( image: string, tag?: string): ContainerResource; withImagePullPolicy(pullPolicy: ImagePullPolicy): ContainerResource; withImageRegistry(registry: string): ContainerResource; withImageSHA256(sha256: string): ContainerResource; withImageTag(tag: string): ContainerResource; withLifetime(lifetime: ContainerLifetime): ContainerResource; withVolume( target: string, name?: string, isReadOnly?: boolean): ContainerResource;} 20 members
Methods
Changes the resource to be published as a connection string reference in the manifest.
publishAsConnectionString(): ContainerResourceReturns
ContainerResource Changes the resource to be published as a container in the manifest.
publishAsContainer(): ContainerResourceReturns
ContainerResource Adds a bind mount to a container resource.
withBindMount( source: string, target: string, isReadOnly?: boolean): ContainerResourceParameters
source string target string isReadOnly boolean optional = False Returns
ContainerResource Adds a build argument when the container is built from a Dockerfile.
withBuildArg( name: string, value: ParameterResource): ContainerResourceParameters
name string value ParameterResource Returns
ContainerResource Adds a secret build argument when the container is built from a Dockerfile.
withBuildSecret( name: string, value: ParameterResource): ContainerResourceParameters
name string value ParameterResource Returns
ContainerResource Adds container certificate path overrides used for certificate trust at run time.
withContainerCertificatePaths( customCertificatesDestination?: string, defaultCertificateBundlePaths?: string[], defaultCertificateDirectoryPaths?: string[]): ContainerResourceParameters
customCertificatesDestination string optional defaultCertificateBundlePaths string[] optional defaultCertificateDirectoryPaths string[] optional Returns
ContainerResource 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.
withContainerName(name: string): ContainerResourceParameters
name string Returns
ContainerResource Adds a network alias to container resource.
withContainerNetworkAlias(alias: string): ContainerResourceParameters
alias string Returns
ContainerResource 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(args: string[]): ContainerResourceParameters
args string[] Returns
ContainerResource Causes Aspire to build the specified container image from a Dockerfile.
withDockerfile( contextPath: string, dockerfilePath?: string, stage?: string): ContainerResourceParameters
contextPath string dockerfilePath string optional stage string optional Returns
ContainerResource Configures the resource to use a programmatically generated Dockerfile
withDockerfileBuilder(contextPath: string, callback: (arg: DockerfileBuilderCallbackContext) => Promise<void>, stage?: string): ContainerResourceParameters
contextPath string callback (arg: DockerfileBuilderCallbackContext) => Promise<void> stage string optional Returns
ContainerResource Builds the specified container image from a Dockerfile generated by an asynchronous factory function.
withDockerfileFactory(contextPath: string, dockerfileFactory: (arg: DockerfileFactoryContext) => Promise<string>, stage?: string): ContainerResourceParameters
contextPath string dockerfileFactory (arg: DockerfileFactoryContext) => Promise<string> stage string optional Returns
ContainerResource Sets the Entrypoint for the container.
withEntrypoint(entrypoint: string): ContainerResourceParameters
entrypoint string Returns
ContainerResource Allows overriding the image on a container.
withImage( image: string, tag?: string): ContainerResourceParameters
image string tag string optional Returns
ContainerResource Sets the pull policy for the container resource.
withImagePullPolicy(pullPolicy: ImagePullPolicy): ContainerResourceParameters
pullPolicy ImagePullPolicy Returns
ContainerResource Allows overriding the image registry on a container.
withImageRegistry(registry: string): ContainerResourceParameters
registry string Returns
ContainerResource Allows setting the image to a specific sha256 on a container.
withImageSHA256(sha256: string): ContainerResourceParameters
sha256 string Returns
ContainerResource Allows overriding the image tag on a container.
withImageTag(tag: string): ContainerResourceParameters
tag string Returns
ContainerResource Sets the lifetime behavior of the container resource.
withLifetime(lifetime: ContainerLifetime): ContainerResourceParameters
lifetime ContainerLifetime Returns
ContainerResource Adds a volume to a container resource.
withVolume( target: string, name?: string, isReadOnly?: boolean): ContainerResourceParameters
target string name string optional isReadOnly boolean optional = False Returns
ContainerResource