Skip to content

Public API for resolving the internal Docker hostname #13709

@brantburnett

Description

@brantburnett

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I'm working on developing an Aspire provider for Couchbase, and to initialize a Couchbase cluster it's important to configure each container's DNS name so they can cross-talk between nodes. For this purpose, I need the internal docker host name, i.e. couchbase-0.dev.internal. So far, the only way I have found to resolve the hostname is by injecting it into an environment variable. Any attempt to resolve it via endpoints and passing the NetworkIdentifier just hangs waiting for the endpoint to be allocated.

The relevant code is here:

(EndpointProperty.Host or EndpointProperty.IPV4Host, true) => $"{target.Name}.dev.internal",

However, I cannot find any publicly accessible code path that reaches this. The only path I've found is the environment variable resolution path.

Describe the solution you'd like

A public API that can perform the more complete and complex ReferenceExpression resolution that is used by environment variables, rather than the more limited GetValueAsync path that hangs.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions