-
Notifications
You must be signed in to change notification settings - Fork 496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set container name to a deterministic value when launching #949
Comments
Also worth following this issue #398 |
Yep, I think the container name change is somewhat orthogonal to my specific case, so I filed this. I can see utility in exec-ing in to the running containers for various reasons. I'll chime in on the other issue with specific thoughts for EF tooling. |
@davidfowl @karolz-ms @mitchdenny would changing the container naming logic require changes just to the app model or in DCP too? |
Container banking is handled by DCP. |
@DamianEdwards I was actually going to send a PR but I quickly found that it was handled by DCP 😢 |
@mitchdenny short of better devault in DCP, try passing |
DCP side of this was checked in for Preview 2. |
cc @JamesNK |
I looked into this, and it is working today without any changes required in hosting. DCP now automatically sets a container name unless one is explicitly specified from hosting. (Docker requires unique names. The random postfix on each name is a safety measure to prevent duplicates) I'll update our DCP DTOs to include the new property, but we don't need to use it. |
Are we adding support for setting the desired container name from an AppHost project? |
I guess we need another issue? |
The hostname changes with each restart of debugging for containers managed by the AppHost. This breaks RabbitMQ queue persistence (with fixed volume mounts configured as well) as queues are bound under a hostname directory. RabbitMQ's internal RabbitMQ naming can be changed by setting the NODENAME environment variable on the container which overrides this behavior - but this can be a source of frustration as no indication as to why queues disappear appear in any log. The following works to override this behavior - but the
|
@pedershk Could you create a new issue? That will ensure it will get looked at. |
Yes, sorry, didn't even notice that this one was closed. I blame lack of coffeee. |
When launching an Aspire app, the created containers are just given the default random docker names:
I have configured my app with a "shell" container to allow invoking dotnet tools like
dotnet-ef
in the context of a service, and I need todocker exec
into it in order to run those commands. It'd be helpful if the containers had a consistent name like[app]_[resource]
or similar, much like howdocker-compose
sets names. Then I could avoid having to look up the container name and could more easily script interactions with running containers (such asexec
ing in to them).The text was updated successfully, but these errors were encountered: