Skip to content

localhost mapping #2811

@biqas

Description

@biqas

Hello,

I have finally tried aspire, was hard to setup in my case because I am developing on an Apple Silicon (M1) and using Parallels Windows ARM for Visual Studio and Linux (Fedora) for Podman.

And The problem I have is I have setup on mac in etc/host the DNS for Fedora Linux so I can access in the Windows VM the Podman containers via DNS. On command line everything is fine, and the environment works fine.

MAC etc/hosts file:
10.211.66.55     fedora.podman

I have not found any possibility to map in Aspire localhost to fedora.podman for resource like Postgres (which is running as a container in fedora Linux as a Podman container) or any other resource.

What i try to do is something like this:

var builder = DistributedApplication.CreateBuilder(args);

// Secrets
var postgresPassword = builder.Configuration["postgres.password"];


// Resources
var postgres = builder.AddPostgres("postgres", password: postgresPassword)
    .WithImageTag("16.2");

var dbA = postgres.AddDatabase("db-a", "db.a");
var dbB = postgres.AddDatabase("Db-b", "db.b");


// Apps
builder.AddProject<Projects.SOME_PROJECT>("some-project")
    .WithReference(dbA)
    .WithReference(dbB);

builder.Build().Run();

this results in that the connection string is like this:
Server=localhost;Port=5432;Database=db.a;User ID=XXX;Password='XXX'

I need to override for this resource to not use localhost but instead fedora.podman.

Is this missing or not supported?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationneeds-author-actionAn issue or pull request that requires more info or actions from the author.no-recent-activity

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions