dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.91k stars 475 forks source link

Possible issue with podman pasta mode networking going from 8 to 9? #6724

Closed atrauzzi closed 3 days ago

atrauzzi commented 3 days ago

Is there an existing issue for this?

Describe the bug

Running with podman rootless:

Aspire.Hosting.Dcp.dcpctrl.ContainerReconciler[0]
      could not create the container    {"Container": {"name":"nginx-proxy-aygwqrtj"}, "Reconciliation": 10, "error": "object not found\ncontainer not found\npodman command 'CreateContainer' returned with non-zero exit code 125: command output: Stdout: '' Stderr: 'Error: can only set extra network names, selected mode pasta conflicts with bridge: invalid argument\n'"}
string[] containerNetworkOptions = ["--network", $"pasta:--map-host-loopback={hostIp}"];

var proxy = builder
    .AddContainer("nginx-proxy", "docker.io/nginx")
    .WithBindMount($"{AppContext.BaseDirectory}/resources/nginx.linux.conf", "/etc/nginx/nginx.conf", true)
    .WithBindMount($"{AppContext.BaseDirectory}/resources/ssl.pem", "/keys/ssl.pem")
    .WithBindMount($"{AppContext.BaseDirectory}/resources/ssl.key", "/keys/ssl.key")
    .WithHttpsEndpoint(443, 443)
    .WithHttpEndpoint(80, 80)
    .WithContainerRuntimeArgs(containerNetworkOptions)
;

Perhaps Aspire 9 is already doing some network stuff under the hood and I should back this off?

atrauzzi commented 3 days ago

Anyway, removing those flags from the command seems to get things running, though I need to sort through some other dotnet 9 migration/dependency issues before I can fully test things.

Would love to see details on what Aspire is doing now internally though. Excited to see it leveraging some more container runtime flags! 😍