Dela via


DockerComposeAspireDashboardResourceBuilderExtensions.WithHostPort Method

Definition

Configures the port used to access the Aspire Dashboard from a browser.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Docker.DockerComposeAspireDashboardResource> WithHostPort(this Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Docker.DockerComposeAspireDashboardResource> builder, int? port = default);
static member WithHostPort : Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Docker.DockerComposeAspireDashboardResource> * Nullable<int> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Docker.DockerComposeAspireDashboardResource>
<Extension()>
Public Function WithHostPort (builder As IResourceBuilder(Of DockerComposeAspireDashboardResource), Optional port As Nullable(Of Integer) = Nothing) As IResourceBuilder(Of DockerComposeAspireDashboardResource)

Parameters

port
Nullable<Int32>

The port to bind on the host. If non-null, the dashboard will be exposed on the host. If null, the dashboard will not be exposed on the host but will only be reachable within the container network.

Returns

The IResourceBuilder<T> instance for chaining.

Applies to