'use strict'; const fs = require('fs'); let isDocker; function hasDockerEnv() { try { fs.statSync('/.dockerenv'); return true; } catch (_) { return false; } } function hasDockerCGroup() { try { return fs.readFileSync('/proc/self/cgroup', 'utf8').includes('docker'); } catch (_) { return false; } } module.exports = () => { if (isDocker === undefined) { isDocker = hasDockerEnv() || hasDockerCGroup(); } return isDocker; };
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
cli.js | File | 105 B | 0755 |
|
index.d.ts | File | 254 B | 0644 |
|
index.js | File | 449 B | 0644 |
|
license | File | 1.09 KB | 0644 |
|
package.json | File | 3.52 KB | 0644 |
|
readme.md | File | 476 B | 0644 |
|