odin-js-fundamentals-part-4/node_modules/is-docker
NetMan 65754e6d19 Ran npm install for whole directory 2024-01-05 20:30:21 +01:00
..
cli.js Ran npm install for whole directory 2024-01-05 20:30:21 +01:00
index.d.ts Ran npm install for whole directory 2024-01-05 20:30:21 +01:00
index.js Ran npm install for whole directory 2024-01-05 20:30:21 +01:00
license Ran npm install for whole directory 2024-01-05 20:30:21 +01:00
package.json Ran npm install for whole directory 2024-01-05 20:30:21 +01:00
readme.md Ran npm install for whole directory 2024-01-05 20:30:21 +01:00

readme.md

is-docker

Check if the process is running inside a Docker container

Install

$ npm install is-docker

Usage

const isDocker = require('is-docker');

if (isDocker()) {
	console.log('Running inside a Docker container');
}

CLI

$ is-docker

Exits with code 0 if inside a Docker container and 2 if not.