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
ContainerResourceChanges the resource to be published as a container in the manifest.
publishAsContainer(): ContainerResourceReturns
ContainerResourceAdds a bind mount to a container resource.
withBindMount( source: string, target: string, isReadOnly?: boolean): ContainerResourceParameters
sourcestringtargetstringisReadOnlybooleanoptional= FalseReturns
ContainerResourceAdds a build argument when the container is built from a Dockerfile.
withBuildArg( name: string, value: ParameterResource): ContainerResourceParameters
namestringvalueParameterResourceReturns
ContainerResourceAdds a secret build argument when the container is built from a Dockerfile.
withBuildSecret( name: string, value: ParameterResource): ContainerResourceParameters
namestringvalueParameterResourceReturns
ContainerResourceAdds container certificate path overrides used for certificate trust at run time.
withContainerCertificatePaths( customCertificatesDestination?: string, defaultCertificateBundlePaths?: string[], defaultCertificateDirectoryPaths?: string[]): ContainerResourceParameters
customCertificatesDestinationstringoptionaldefaultCertificateBundlePathsstring[]optionaldefaultCertificateDirectoryPathsstring[]optionalReturns
ContainerResourceOverrides 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
namestringReturns
ContainerResourceAdds a network alias to container resource.
withContainerNetworkAlias(alias: string): ContainerResourceParameters
aliasstringReturns
ContainerResourceAdds 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
argsstring[]Returns
ContainerResourceCauses Aspire to build the specified container image from a Dockerfile.
withDockerfile( contextPath: string, dockerfilePath?: string, stage?: string): ContainerResourceParameters
contextPathstringdockerfilePathstringoptionalstagestringoptionalReturns
ContainerResourceConfigures the resource to use a programmatically generated Dockerfile
withDockerfileBuilder(contextPath: string, callback: (arg: DockerfileBuilderCallbackContext) => Promise<void>, stage?: string): ContainerResourceParameters
contextPathstringcallback(arg: DockerfileBuilderCallbackContext) => Promise<void>stagestringoptionalReturns
ContainerResourceBuilds the specified container image from a Dockerfile generated by an asynchronous factory function.
withDockerfileFactory(contextPath: string, dockerfileFactory: (arg: DockerfileFactoryContext) => Promise<string>, stage?: string): ContainerResourceParameters
contextPathstringdockerfileFactory(arg: DockerfileFactoryContext) => Promise<string>stagestringoptionalReturns
ContainerResourceSets the Entrypoint for the container.
withEntrypoint(entrypoint: string): ContainerResourceParameters
entrypointstringReturns
ContainerResourceAllows overriding the image on a container.
withImage( image: string, tag?: string): ContainerResourceParameters
imagestringtagstringoptionalReturns
ContainerResourceSets the pull policy for the container resource.
withImagePullPolicy(pullPolicy: ImagePullPolicy): ContainerResourceParameters
pullPolicyImagePullPolicyReturns
ContainerResourceAllows overriding the image registry on a container.
withImageRegistry(registry: string): ContainerResourceParameters
registrystringReturns
ContainerResourceAllows setting the image to a specific sha256 on a container.
withImageSHA256(sha256: string): ContainerResourceParameters
sha256stringReturns
ContainerResourceAllows overriding the image tag on a container.
withImageTag(tag: string): ContainerResourceParameters
tagstringReturns
ContainerResourceSets the lifetime behavior of the container resource.
withLifetime(lifetime: ContainerLifetime): ContainerResourceParameters
lifetimeContainerLifetimeReturns
ContainerResourceAdds a volume to a container resource.
withVolume( target: string, name?: string, isReadOnly?: boolean): ContainerResourceParameters
targetstringnamestringoptionalisReadOnlybooleanoptional= FalseReturns
ContainerResource