$ gnpm install is-docker
Check if the process is running inside a Docker container
$ npm install is-docker
import isDocker from 'is-docker';
if (isDocker()) {
console.log('Running inside a Docker container');
}
$ is-docker
Exits with code 0 if inside a Docker container and 2 if not.
Copyright 2013 - present © cnpmjs.org | Home |