'use strict';
var fs = require('fs');
var isDocker;

function check() {
	try {
		fs.statSync('/.dockerinit');
		return true;
	} catch (err) {
		return false;
	}
}

module.exports = function () {
	if (isDocker === undefined) {
		isDocker = check();
	}

	return isDocker;
};

'use strict';
var fs = require('fs');
var isDocker;

function check() {
	try {
		fs.statSync('/.dockerinit');
		fs.statSync('/.dockerenv');
		return true;
	} catch (err) {
		return false;
	}
}

module.exports = function () {
	if (isDocker === undefined) {
		isDocker = check();
	}

	return isDocker;
};

Use /.dockerenv as a fallback mechanism
Use /.dockerenv as a fallback mechanism

On my machine, /.dockerinit was not present. Since I'm using a fresh install from
[brew](http://brew.sh/), I suspect I'm not the only one with this problem. This patch
updates is-docker to check for a /.dockerenv file if /.dockerinit is not found.

Closes #1
