How to Set Custom Docker Network Name in .NET Aspire Publish? #8844
-
I'm using the latest version of .NET Aspire 9.2 with the new Aspire.Hosting.Docker and deploying multiple applications to the same server using aspire publish. I've noticed that each generated Docker Compose file assigns containers to a default network named aspire. ("aspire") This becomes problematic when deploying multiple applications, as they all share the same network name, leading to potential conflicts. Question: Example: Would implementing this approach ensure that each application's containers are assigned to a unique Docker network, thereby preventing conflicts when multiple applications are deployed on the same server? I'm looking for a solution that integrates seamlessly with the aspire publish workflow, without requiring manual edits to the generated Docker Compose files. Any guidance or best practices on this matter would be greatly appreciated. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
It's not possible in 9.2 (we're still super early!). Some changes just went into 9.3 to allow mutating the compose service after it's been built. Thanks for using the feature and leaving this feedback! |
Beta Was this translation helpful? Give feedback.
-
@benreisinger in 9.2 it's possible to use builder.AddDockerComposePublisher(o => o.ExistingNetworkName= "xx"); |
Beta Was this translation helpful? Give feedback.
@benreisinger in 9.2 it's possible to use