Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

AddContainer

Method
📦 Aspire.Hosting v17.0.0
func (DistributedApplicationBuilder) AddContainer(
name string,
image any,
) ContainerResource

Signature

methodAddContainerbuilder
Adds a container resource to the application.
AddContainer(
name string,
image any,
) ContainerResource
namestringThe name of the resource.
imageanyThe image name or image options for the container.
ContainerResource

The resource builder.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: