You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be very useful if there was a way to find out the container name (like, projectname_webserver_1) from inside of it, to use it as some kind of an id (like for kafka, or in the logs).
The only way to get it which I could find is by parsing it out from some *_NAME environment variable, which requires the container to have links, and feels bad.
The text was updated successfully, but these errors were encountered:
It's a shame this and duplicate have been closed without an official way to get the container name. The best seems to be this workaround which requires having dig installed in the container.
I realise that the hostname contains the container id and I do log this, but it would be much more helpful to filter by name as this immediately conveys meaning when looking at the logs and also can be filtered on long-term (across multiple different containers over time).
It would be very useful if there was a way to find out the container name (like,
projectname_webserver_1
) from inside of it, to use it as some kind of an id (like for kafka, or in the logs).The only way to get it which I could find is by parsing it out from some *_NAME environment variable, which requires the container to have links, and feels bad.
The text was updated successfully, but these errors were encountered: