denisbrodbeck / machineid

Get the unique machine id of any host (without admin privileges)
MIT License
985 stars 139 forks source link

[question] using machineid on docker container. #15

Closed twiny closed 2 years ago

twiny commented 3 years ago

hello,

I m using machineid on an Alpine docker image. is there anyway to extract the machine unique ID right from the container?

Thanks

icsy7867 commented 2 years ago

Are you trying to get a unique ID of the container? Or the unique ID of the host running on the container?

I haven't tried, but if you want the unique ID of the host from the container, you could try to pass /var/lib/dbus/machine-id as a read only mount.

If you want a unique ID of the container, maybe try to install dbus? https://pkgs.alpinelinux.org/package/edge/main/x86/dbus