"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "isDocker", {
    enumerable: true,
    get: function() {
        return isDocker;
    }
});
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
let isDockerCached = undefined;
function hasDockerEnv() {
    try {
        _fs.default.statSync("/.dockerenv");
        return true;
    } catch  {
        return false;
    }
}
function hasDockerCGroup() {
    try {
        return _fs.default.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
    } catch  {
        return false;
    }
}
function isDocker() {
    if (isDockerCached === undefined) {
        isDockerCached = hasDockerEnv() || hasDockerCGroup();
    }
    return isDockerCached;
}

//# sourceMappingURL=is-docker.js.map