Closed McDefault closed 2 years ago
Hello,
this is not really the container ID but the system hostname.
The Python function socket.gethostname() returns the host name of the current system under which the Python interpreter is executed
Correct. Im aware of that. However. It does corrolate with the container ID
The container ID is a hash. You are talking about the container "name"
From the point of view of whoami, it doesn't know if there is a container or not.
I think your request is about adding the hostname information to some endpoints of the whoami.
The hostname is already a part of the information returned by the whoami.
https://github.com/traefik/whoami/blob/2d6ebedb0f2217d81d26c8672d81d3d26a587e7a/app.go#L211-L212
The container ID is a hash. You are talking about the container "name"
I don't mean the name, but i understand the confusion. Actually is it indeed already there. like you said.
I just realised I overrode it with the hostname property in my compose-file so it dind't show the correct container_ID.
Anyways good to see it's already there! Thank for the replies trying to help
I'm using this repo to check my Docker container id
They are displaying it with python like so:
source
Now my question is: is it possible to add container ID info to this list in whoami?