Skip to content
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

No hardware info in Docker environment #78

Closed
pccai opened this issue Feb 25, 2025 · 1 comment
Closed

No hardware info in Docker environment #78

pccai opened this issue Feb 25, 2025 · 1 comment

Comments

@pccai
Copy link

pccai commented Feb 25, 2025

docker desktop
net8.0
the results is blank!

` foreach (var hardware in hardwareInfo.BiosList)
Console.WriteLine(hardware);

     foreach (var hardware in hardwareInfo.ComputerSystemList)
         Console.WriteLine(hardware);

    foreach (var hardware in hardwareInfo.MotherboardList)
        Console.WriteLine(hardware);`
@Jinjinov Jinjinov changed the title How about run docker enviroment No hardware info in Docker environment Feb 25, 2025
@Jinjinov
Copy link
Owner

Hardware.Info is designed to access the local machine's hardware through system APIs - WMI on Windows, /dev, /proc, /sys on Linux and sysctl, system_profiler on macOS - which are not available inside a Docker container.

In Docker, the container is isolated, so it doesn't have access to the host's hardware info unless you run it with elevated privileges (for example, using the --privileged flag).

@Jinjinov Jinjinov pinned this issue Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants