Host Machine-id visible from containers

Good evening,
since there is a lot of people arguing about licensing check from within containers, I was wondering if it were possible to have a new feature in docker CLI and in docker images base files such that

#docker machine-id
or similar
returns a unique uuid for the docker host

and

#cat /dev/machine-id
or similar
from within container returns the very same uuid returned by the cli command from the host machine

Thank you very much

I would also be interested in this feature, or if there is any workaround to achieve the same result. The idea is that each container should be able to have a unique and immutable id, which therefore takes into account some unique properties of the host machine, such as the machine-id in unix based os.

@frazcake My intent is to get the same id within every container, not a different id in each container… and they should be based on the host machine so that containers running on different hosts see different ids.

2 Likes

Have you found a proper solution for this issue? If so, could you please share it?

No, I’m sorry, for the moment I had to create a file on the host machine and mount it in the containers.
I create the file with a npm task before launching docker-compose. I use something like machineid so that every project on my computer create the file with the same content. Of course it’s not a solution because it is hackable changing the file content or moving the file across different servers