is-docker
Check if the process is running inside a Docker container
Last updated 9 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install is-docker 
SYNC missed versions from official npm registry.

is-docker

Check if the process is running inside a Docker container

Install

$ npm install is-docker

Usage

import isDocker from '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.

Current Tags

  • 3.0.0                                ...           latest (3 years ago)

9 Versions

  • 3.0.0                                ...           3 years ago
  • 2.2.1                                ...           4 years ago
  • 2.2.0                                ...           4 years ago
  • 2.1.1                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.0                                ...           6 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)

Copyright 2013 - present © cnpmjs.org | Home |