MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / detectDocker

Function detectDocker

packages/cli/src/telemetry/system.ts:87–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85// ---------------------------------------------------------------------------
86
87function detectDocker(): boolean {
88 // Standard detection: /.dockerenv file or "docker" in /proc/1/cgroup
89 try {
90 if (existsSync("/.dockerenv")) return true;
91 if (platform() === "linux") {
92 const cgroup = readFileSync("/proc/1/cgroup", "utf-8");
93 if (cgroup.includes("docker") || cgroup.includes("containerd")) return true;
94 }
95 } catch {
96 // Ignore — not in Docker
97 }
98 return false;
99}
100
101// Named providers come first so getCIName() picks the most specific match.
102// `truthy` accepts 'true' or '1'; `presence` matches any non-null value.

Callers 1

getSystemMetaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected